I'm testing BLE secure communication with the nRF52840DK device and I have encountered a problem with bonds. I use modified example from BLE fundamental course, in which I added ability to determine if we connected to new or bonded client. The following steps will better describe my issue:
- Perform connection, pairing, and bonding with the nRF52840DK(Nordic_LBS).
- Subscribe to Button characteristic notification(write to its CCCD 0x0001 value).
- Disconnect from nRF52840DK(Nordic_LBS).
- Remove bonds on the client's side. (Bonds on nRF52840DK(Nordic_LBS) still present):
- Perform connection with the same nRF Connect client. As you can see, nRF52840DK(Nordic_LBS) still assume that it bonded with client.
- Check Button characteristic CCCD value.
Expected result: 0x0000
Actual result: 0x0001
Same situation occurs even if in step 5 I perform connection, pairing, bonding again with the device. nRF connect logs and modified example attached.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
nRF Connect, 2025-04-29
Nordic_LBS (C5:9D:AD:DC:BB:A3)
V 10:54:20.015 Connecting to C5:9D:AD:DC:BB:A3...
D 10:54:20.015 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 10:54:20.300 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 10:54:20.301 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 10:54:20.301 Connected to C5:9D:AD:DC:BB:A3
V 10:54:20.302 Discovering services...
D 10:54:20.302 gatt.discoverServices()
D 10:54:20.425 [Callback] Services discovered with status: 0
I 10:54:20.425 Services discovered
V 10:54:20.426 Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
···Client Characteristic Configuration (0x2902)
- Client Supported Features [R W] (0x2B29)
- Database Hash [R] (0x2B2A)
Generic Access (0x1800)
- Device Name [R] (0x2A00)
- Appearance [R] (0x2A01)
Please advise if it is possible to handle that situation on the side. Or should it be handled on the client side and how?