Skip to content

Commit 7b660f3

Browse files
committed
feat(bt): Add test to 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.
1 parent 12d73ba commit 7b660f3

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./ble_test_central.exe -d=2 -disconnect_and_reconnect -clear_bond_on_disconnect
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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}//p
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <behaviors.dtsi>
2+
#include <dt-bindings/zmk/bt.h>
3+
#include <dt-bindings/zmk/keys.h>
4+
#include <dt-bindings/zmk/kscan_mock.h>
5+
6+
&kscan {
7+
events =
8+
<ZMK_MOCK_PRESS(0,0,10000)
9+
ZMK_MOCK_RELEASE(0,0,2000)
10+
ZMK_MOCK_PRESS(0,1,100)
11+
ZMK_MOCK_RELEASE(0,1,1000)>;
12+
};
13+
14+
/ {
15+
keymap {
16+
compatible = "zmk,keymap";
17+
label = "Default keymap";
18+
19+
default_layer {
20+
bindings = <
21+
&kp A &kp B
22+
&bt BT_SEL 0 &bt BT_SEL 1>;
23+
};
24+
};
25+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<wrn> bt_id: No static addresses stored in controller
2+
<dbg> ble_central: _posix_zephyr_main: [Bluetooth initialized]
3+
<dbg> ble_central: start_scan: [Scanning successfully started]
4+
<dbg> ble_central: device_found: [DEVICE]: ED:3B:20:15:18:12 (random), AD evt type 0, AD data len 15, RSSI -59
5+
<dbg> ble_central: eir_found: [AD]: 9 data_len 0
6+
<dbg> ble_central: eir_found: [AD]: 25 data_len 2
7+
<dbg> ble_central: eir_found: [AD]: 1 data_len 1
8+
<dbg> ble_central: eir_found: [AD]: 2 data_len 4
9+
<dbg> ble_central: connected: [Connected]: ED:3B:20:15:18:12 (random)
10+
<dbg> ble_central: connected: [Setting the security for the connection]
11+
<dbg> ble_central: pairing_complete: Pairing complete
12+
<dbg> ble_central: disconnected: [Disconnected]: ED:3B:20:15:18:12 (random) (reason 0x16)
13+
<dbg> ble_central: start_scan: [Scanning successfully started]
14+
<dbg> ble_central: device_found: [DEVICE]: ED:3B:20:15:18:12 (random), AD evt type 0, AD data len 15, RSSI -59
15+
<dbg> ble_central: eir_found: [AD]: 9 data_len 0
16+
<dbg> ble_central: eir_found: [AD]: 25 data_len 2
17+
<dbg> ble_central: eir_found: [AD]: 1 data_len 1
18+
<dbg> ble_central: eir_found: [AD]: 2 data_len 4
19+
<dbg> ble_central: connected: [Connected]: ED:3B:20:15:18:12 (random)
20+
<dbg> ble_central: connected: [Setting the security for the connection]
21+
<dbg> ble_central: pairing_complete: Pairing complete
22+
<dbg> ble_central: discover_conn: [Discovery started for conn]
23+
<dbg> ble_central: discover_func: [ATTRIBUTE] handle 23
24+
<dbg> ble_central: discover_func: [ATTRIBUTE] handle 28
25+
<dbg> ble_central: discover_func: [ATTRIBUTE] handle 30
26+
<dbg> ble_central: discover_func: [SUBSCRIBED]
27+
<dbg> ble_central: notify_func: payload
28+
00 00 04 00 00 00 00 00 |........
29+
<dbg> ble_central: notify_func: payload
30+
00 00 00 00 00 00 00 00 |........
31+
<dbg> ble_central: notify_func: payload
32+
00 00 05 00 00 00 00 00 |........
33+
<dbg> ble_central: notify_func: payload
34+
00 00 00 00 00 00 00 00 |........
35+
<dbg> ble_central: notify_func: payload
36+
00 00 00 00 00 00 00 00 |........

0 commit comments

Comments
 (0)