testing: Add split BLE tests (#2737)

* Enhance the BLE test runner to build additional peripheral builds
  when detecting peripheral*.overlay files in the test.
* Add basic and multiple-peripheral tests to exercise the testing
  support
* Add test for triggering local behaviors on split peripherals.

fix(ble): Fix building split code w/o settings

* Properly exclude storing peripheral addresses to settings when
  settings support isn't turned on.
This commit is contained in:
Pete Johanson
2025-01-01 16:13:47 -07:00
committed by GitHub
parent 3f6841c95f
commit 85aba16eec
30 changed files with 216 additions and 5 deletions

View File

@@ -0,0 +1 @@
s/^d_02: @[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9] .{19}/profile 0 /p

View File

@@ -0,0 +1,2 @@
CONFIG_ZMK_SPLIT=y
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2

View File

@@ -0,0 +1,19 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
&kscan {
/delete-property/ exit-after;
events = <>;
};
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp A &kp B
&bt BT_SEL 0 &bt BT_CLR>;
};
};
};

View File

@@ -0,0 +1,10 @@
#include <dt-bindings/zmk/kscan_mock.h>
&kscan {
events =
<ZMK_MOCK_RELEASE(0,0,3000)
ZMK_MOCK_PRESS(0,1,5000)
ZMK_MOCK_RELEASE(0,1,200)>;
};

View File

@@ -0,0 +1,10 @@
#include <dt-bindings/zmk/kscan_mock.h>
&kscan {
events =
<ZMK_MOCK_RELEASE(0,0,5000)
ZMK_MOCK_PRESS(0,0,5000)
ZMK_MOCK_RELEASE(0,0,200)>;
};

View File

@@ -0,0 +1,3 @@
./ble_test_central.exe -d=2
./tests_ble_split_multiple-peripherals_peripheral1.exe -d=3
./tests_ble_split_multiple-peripherals_peripheral2.exe -d=4

View File

@@ -0,0 +1,23 @@
profile 0 <wrn> bt_id: No static addresses stored in controller
profile 0 <dbg> ble_central: main: [Bluetooth initialized]
profile 0 <dbg> ble_central: start_scan: [Scanning successfully started]
profile 0 <dbg> ble_central: device_found: [DEVICE]: FD:9E:B2:48:47:39 (random), AD evt type 0, AD data len 15, RSSI -55
profile 0 <dbg> ble_central: eir_found: [AD]: 25 data_len 2
profile 0 <dbg> ble_central: eir_found: [AD]: 1 data_len 1
profile 0 <dbg> ble_central: eir_found: [AD]: 2 data_len 4
profile 0 <dbg> ble_central: connected: [Connected]: FD:9E:B2:48:47:39 (random)
profile 0 <dbg> ble_central: connected: [Setting the security for the connection]
profile 0 <dbg> ble_central: pairing_complete: Pairing complete
profile 0 <dbg> ble_central: discover_conn: [Discovery started for conn]
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 23
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 28
profile 0 <dbg> ble_central: discover_func: [ATTRIBUTE] handle 30
profile 0 <dbg> ble_central: discover_func: [SUBSCRIBED]
profile 0 <dbg> ble_central: notify_func: payload
profile 0 00 00 05 00 00 00 00 00 |........
profile 0 <dbg> ble_central: notify_func: payload
profile 0 00 00 05 04 00 00 00 00 |........
profile 0 <dbg> ble_central: notify_func: payload
profile 0 00 00 00 04 00 00 00 00 |........
profile 0 <dbg> ble_central: notify_func: payload
profile 0 00 00 00 00 00 00 00 00 |........