With newlib_libc enabled, a warning was printed for this sprintf.
The settings_name may expand to 17 characters instead of the available
15.
Fixes#808.
Full warning:
[49/272] Building C object CMakeFiles/app.dir/src/ble.c.obj
In file included from /home/okke/.local/zephyr-sdk-0.11.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from ../../src/ble.c:12:
../../src/ble.c: In function 'set_profile_address':
../../src/ble.c:118:27: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=]
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~~~~~~~~~~~
../../src/ble.c:118:41: note: format string is defined here
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~
In file included from /home/okke/.local/zephyr-sdk-0.11.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from ../../src/ble.c:12:
../../src/ble.c:118:27: note: directive argument in the range [0, 255]
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~~~~~~~~~~~
../../src/ble.c:118:5: note: '__builtin___sprintf_chk' output between 15 and 17 bytes into a destination of size 15
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~
* Make it easier to use *just* event payloads by defining the data,
and then having event manager macros generate "wrapper structs"
* Improve is_*/cast_* APIs to hide details of full event struct.
* Create `zmk_event_t` typedef to pass to event handlers.
* Bring event names inline w/ consistent `zmk_` prefix.
Aligns *.h and *.c to underscore naming convention.
These were kept (with warnings) for backwards compatibility with external boards/shields:
- kscan-mock.h
- matrix-transform.h
They should be removed in the future.
PR: #523
Silences the following build warning ...
../src/ble.c:407:13: warning: 'auth_passkey_display' defined but not used [-Wunused-function]
407 | static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) {
Added zmk_ble_active_profile_is_connected() to allow code outside ble.c to check
the status of the active profile, and changed the ble_active_profile_changed
event to also notify when the active profile connects or disconnects.
Changed endpoint selection to to also update when the active profile changes,
connects, or disconnects.
* Add back in profiles, not using Zephyr
BT identity infrastructure.
* Restore additional `&bt` commands for profile
operations.
* Fix for split pairing and subscriptions, since
Zephyr persists subscriptions across connects.
* Remove keymap from peripheral builds, reduces
firmware size, and avoids unneeded attempts
to send HID data.
* Simplify the `bt` behavior to one current command
`BT_CLEAR_BONDS_CMD`.
* Simplify BLE code for split and non-split keyboards.
* Remove keymap processing from split peripheral side.
* Add `bt` behavior that can be used to perform certain actions,
such as next/prev identity, reset identity, etc.
NOTE: Multiple identities is only supported for non-split shields,
due to missing Zephyr identity functionality for dual
central/peripheral devices.
* Proper bond reset tied to action, that honors peripheral bonds,
so folks can reset and pair to other hosts, without breaking
bonds between splt halves.
* Especially for splits, we need the ability to
unpair all paired devices as sledgehammer
if we need to "reset things", and doing so via
keymaps isn't suitable.
* Allows shields to define a collection of key
positions that if all held 2 seconds after
startup, will unpair all existing pairs for the
device.
* Service for split peripheral to report
position state to split central.
* Updated advertising info.
* Behavior for split BT until we have a proper
event system.