Commit Graph

2457 Commits

Author SHA1 Message Date
Peter Johanson
7652fbeb6b fix(split): Split peripherals should auto sec req still.
* Ensure split peripherals have `BT_GATT_AUTO_SEC_REQ` enabled so that
  reconnects to centrals are automatically encrypted.
2024-01-06 00:53:49 -08:00
Peter Johanson
12bc8b0402 fix: Fix function signatures for WPM.
* Recent refactor accidentally used the wrong signatures for a few
  WPM function definitions.
2024-01-05 16:09:34 -08:00
Leonardo Bispo
cebf651d11
fix(boards): include the right flash info in XIAO BLE overlay 2024-01-05 19:00:32 -05:00
Peter Johanson
395ffaa790 fix(ble): Properly send mouse HoG using worker.
* Properly send mouse HoG reports using our worker to avoid thread issues.
2024-01-05 12:17:59 -08:00
Peter Johanson
74875314f8 feat(ble): Request encryption if notifying fails
* 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.
2024-01-05 12:17:59 -08:00
Pete Johanson
69f962fab2 feat(ble): Add security related tests.
* 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.
2024-01-05 12:17:59 -08:00
Peter Johanson
bc7b4b56bd fix(ble): Disable Auto Sec Req again.
* 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.
2024-01-05 12:17:59 -08:00
Chris Andreae
7d1c1ae8fd fixup! docs
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-01-05 12:16:38 -08:00
Chris Andreae
7b9466c7dc fixup! add documentation for BT_CLR_ALL 2024-01-05 12:16:38 -08:00
Chris Andreae
194a9790eb fixup! use wider type for loop iterator 2024-01-05 12:16:38 -08:00
Chris Andreae
b813f34e34 fixup! bt: add BT_CLR_ALL behaviour 2024-01-05 12:16:38 -08:00
Chris Andreae
f4fe7fa40f Extract common behaviour of clearing a bond 2024-01-05 12:16:38 -08:00
Chris Andreae
604c95118e Remove error reporting from ble utility functions that never error 2024-01-05 12:16:38 -08:00
Chris Andreae
b8cb407351 lint: use correct type signature for Zephyr callbacks 2024-01-05 12:16:38 -08:00
Chris Andreae
7a5155f36e lint: add (void) parameter to pass -Wstrict-prototypes
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.
2024-01-05 12:16:38 -08:00
moergo-sc
5257cde1f5 bt: add BT_CLR_ALL behaviour
Defines behaviour to clear all paired Bluetooth profiles
2024-01-05 12:16:38 -08:00
Justin Ridgewell
6f8d080b6a
fix: Use zmk_battery_state_of_charge in battery widgets 2024-01-05 15:02:06 -05:00
Cem Aksoylar
b3146e665e
feat(blog): Add post for joelspadin projects for spotlight series (#2092)
Co-authored-by: Joel Spadin <joelspadin@gmail.com>
2024-01-05 10:42:04 -08:00
Gabor Hornyak
0e2f94b73b feat(ble): Support perhipheral battery levels.
* 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>
2024-01-03 09:26:51 -08:00
honorless
d35311af97 refactor: remove misleading build warning
* 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.
2023-12-30 18:26:00 -08:00
honorless
7ef6ec7560 refactor: remove unused Kconfig files 2023-12-30 18:26:00 -08:00
jack
c965e35140
chore: Ignore python virtualenv files 2023-12-27 10:07:55 -08:00
Peter Johanson
a593c7260a feat(bt): Add test for unauth overwrite.
* Add a test to ensure unauth overwrite does the right thing when
  hosts try to pair again without the profile cleared on the ZMK side.
2023-12-18 13:18:09 -08:00
Cem Aksoylar
12d73ba4f9 fix(docs): Fix remark on &bt parameter #2 2023-12-17 17:38:07 -08:00
Cem Aksoylar
78fa1e77c4 feat(blog): Add nodefree-config post for spotlight series
Co-authored-by: Robert U <978080+urob@users.noreply.github.com>
2023-12-16 21:55:45 -08:00
Peter Johanson
1b8b6b4a0e refactor(core): Make low priority queue optional.
* 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.
2023-12-16 17:10:45 -08:00
Peter Johanson
f4f402fa44 fix(ci): Use unique artifact for test logs
* To address conflicts with identically named artifact uploads, include the
  test name in the artifact name.
2023-12-15 13:23:51 -08:00
Peter Johanson
9b3a98691c refactor(bt): Split security and conn exp. Kconfig
* 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>
2023-12-15 08:59:03 -08:00
Peter Johanson
52ed49b4bb fix(ci): Upgrade to github-script@v7
* Also adjust form @actions/upload API changes.
2023-12-13 11:48:28 -08:00
Cem Aksoylar
ff57ccc75a feat(shields): Allow settings_reset to build with board-only keyboards 2023-12-13 11:29:33 -08:00
Hooky
2c50cff891
feat(kscan): Add charlieplex keyscan driver
* Supports matrixes with and without additional interrupt pin use.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2023-12-09 17:10:05 -05:00
Peter Johanson
b35a5e83c0 fix(shields): Don't enable passkey support on Uno.
* The ZMK Uno has no way to input the full range of digits, so skip
  that setting so it's not pulled in by BLE experimental feature flag.
2023-12-08 14:57:23 -08:00
Peter Johanson
63c8c5700a feat(bt): Add more experimental tweaks.
* Support auto security upgrade for splits properly.
* Disable 2M and legacy LLCP if the experimental
  Kconfig flag is selected.
2023-12-08 14:57:23 -08:00
Peter Johanson
96f9031951 fix(build): Only copy if zephyr module detected
* To fix issues with breakage with existing user config
  repos, only do our copy strategy if we detect a zephyr module
  present in the repo as well.
2023-12-08 10:49:27 -08:00
Cem Aksoylar
384637ae6c fix(docs): Fix text blurb about split Kconfig.defconfig 2023-12-06 22:50:06 -08:00
Cem Aksoylar
09d47d8117 refactor(docs): Convert breaks to unordered lists in tables
Co-authored-by: Joel Spadin <joelspadin@gmail.com>
2023-12-06 22:46:03 -08:00
Cem Aksoylar
55bf7cae7e feat(docs): Note how parameters are forwarded for behaviors 2023-12-06 22:46:03 -08:00
Cem Aksoylar
56d863cba6 feat(docs): Document sensor-rotate in behaviors config 2023-12-06 22:46:03 -08:00
Cem Aksoylar
2bab81a304 fix(docs): Note -var definition files for macros 2023-12-06 22:46:03 -08:00
Cem Aksoylar
76a209c728 fix(docs): Fix sticky key #binding-cells 2023-12-06 22:46:03 -08:00
Cem Aksoylar
f3ad08b619 fix(docs): Add missing page pointers in behaviors config 2023-12-06 22:46:03 -08:00
Peter Johanson
88338a9b3c feat(shields): Add ZMK Uno split setup
* Make it easier to test split code with ZMK Uno
  hardware by adding a split left/right setup as well.
2023-12-06 15:00:29 -08:00
Peter Johanson
291bbc2257 refactor(docs): New shield guide to suggest modules
* 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>
2023-12-06 09:36:37 -08:00
Peter Johanson
3656ec63d0 feat(build): Build unified config/mod repos.
* 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`.
2023-12-06 09:36:37 -08:00
Peter Johanson
efd403a567 refactor: Hook into CMake loading in a better spot.
* 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.
2023-12-06 09:36:37 -08:00
Peter Johanson
0ab6a0ad11 feat(bt): Add new experimental Kconfig setting.
* In order to have an easy way to test and phase in BT changes, add a
  new `ZMK_BLE_EXPERIMENTAL_FEATURES` Kconfig setting.
2023-12-06 09:22:50 -08:00
Joel Spadin
17a6f0b128 refactor: Remove new uses of label property
Removed new uses of the "label" property which were introduced after
the previous commits on this branch were written.
2023-12-04 20:06:54 -06:00
Joel Spadin
0fd8e25807 docs: Document behavior name length limit
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.
2023-12-04 20:06:54 -06:00
Joel Spadin
23ecf08119 refactor(behaviors)!: Remove labels from behaviors
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.
2023-12-04 20:06:54 -06:00
Joel Spadin
36eda571b7 refactor(behaviors): Create a list to lookup behaviors
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().
2023-12-04 20:06:54 -06:00