* If attempting to notify and getting an EPERM return value, request
upgrading the security of the connection at that moment, since it
likely means we got a connection to a bonded host but the connection
hasn't been upgraded to encrypted yet.
* Add security related tests to verify behavior when trying to read
a GATT characteristic from our peripheral with and without client
auto security request/retry.
* Auto security request actually makes macOS worse, so disable it,
and remove our early request in favor of using GATT enforcement
to ensure connections are secured.
Note there was one place where a non-strict prototype was actually being used
with an argument, in `zmk_hog_init`. In this case, the actual argument type was
added instead.
* Add ability to fetch and report peripheral battery levels
on split centrals.
* Add additional support for adding a new Battery Level
service to split centrals that exposes fetched peripheral
battery levels to connected hosts.
Co-authored-by: Peter Johanson <peter@peterjohanson.com>
* Among other issues, this message is often misinterpreted by users
building out-of-tree shields -- leading them to think the shield
"not being found" is the cause of a build failure.
* Add a new Kconfig symbol to enable the low priority queue, and make
the two features that depend on it `select` the symbol to turn it on.
This helps ensure no wasted RAM/ROM on devices that don't need it.
* Split connection and security experimental changes into dedicated
Kconfig flags for easier testing of only connection related fixes.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
* Update the new shield guide to position Zephyr module location
as the default when creating new shields, with a note about
using ZMK repository itself as a last resort.
* Document building with additional Zephyr modules.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
* Detect in our build script if our config repo is *also* a Zephyr
module and if so pass to ZMK build in ZMK_EXTRA_MODULES
define.
* Copy config directory contents to new independent temp workspace
to avoid Kconfig conflicts between the build repo's zephyr module
directory and the checkout zephyr pulled in by `west update`.
* Shift to using an extra Zephyr module to do keymap location
work after all board roots are resolved. This avoids duplicate work
and allows us to load custom boards from Zephyr modules as well as
user config setups.
Added a section to the new behavior guide to document that the names of
behaviors invoked on the peripheral side of a split must be at most 8
characters long.
Removed the label property from built-in behaviors, custom behaviors
defined in a few keymaps, and macros generated with ZMK_MACRO().
Now that node names are used to identify behaviors, and names only need
to be unique within the set of behaviors, the names of all behaviors
have been shortened to be similar to their original labels.
This means that any keymaps which reference behavior nodes by name
instead of by label will need to be updated. Keymaps typically use the
labels though, so most keymaps should be unaffected by this change.
Added BEHAVIOR_DT_DEFINE() and BEHAVIOR_DT_INST_DEFINE(), which work
exactly like the DEVICE_*_DEFINE() macros, except they also register the
device as a behavior by adding a pointer to it to a memory section.
Added zmk_behavior_get_binding(), which works like device_get_binding()
except that it only searches the devices that have been registered as
behaviors. This ensures that behaviors cannot have name collisions with
other devices defined by the SoC, which will be important when we remove
the label property from behaviors so they are given their node names.
As an added benefit, this is faster since it searches a smaller list.
Some basic benchmark code I wrote indicates it takes 30-70% as long,
depending on where the behavior is in the list and whether the name
string is an exact pointer match.
From now on, behaviors should use BEHAVIOR_*_DEFINe() instead of
DEVICE_*_DEFINE(), and any code that looks up a behavior by name should
use zmk_behavior_get_binding() instead of device_get_binding().