Hi!
My setup:
* nRF52 DK (let's name it N)
* nRF5_SDK_15.0.0_a53641a
* s132_nrf52_6.0.0
* SES V3.34b 64-bit
* two android smartphones (let's name them A1 and A2)
I am using multiperipheral example and I have came across an issue. Scenario with one master and one peripheral:
A1 connects to N
terminal log: <info> app: Connection with link 0x0 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x0 has been disconnected. Reason: 0x13
A1 connects to N
terminal log: <info> app: Connection with link 0x1 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x1 has been disconnected. Reason: 0x13
A1 connects to N
terminal log: <info> app: Connection with link 0x0 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x0 has been disconnected. Reason: 0x13
Scenario with two masters and one peripheral:
A1 connects to N
terminal log: <info> app: Connection with link 0x0 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x0 has been disconnected. Reason: 0x13
A2 connects to N
terminal log: <info> app: Connection with link 0x1 established.
A2 disconnects from N
terminal log: <info> app: Connection 0x1 has been disconnected. Reason: 0x13
A1 connects to N
terminal log: <info> app: Connection with link 0x2 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x2 has been disconnected. Reason: 0x13
Another scenario with two masters and one peripheral:
A1 connects to N
terminal log: <info> app: Connection with link 0x0 established.
A2 connects to N
terminal log: <info> app: Connection with link 0x1 established.
A1 disconnects from N
terminal log: <info> app: Connection 0x0 has been disconnected. Reason: 0x13
A2 disconnects from N
terminal log: <info> app: Connection 0x1 has been disconnected. Reason: 0x13
A1 connects to N
terminal log: <info> app: Connection with link 0x2 established.
A2 connects to N
terminal log: <info> app: Connection with link 0x0 established.
The function responsible for connection prints is:
NRF_LOG_INFO("Connection with link 0x%x established.", p_gap_evt->conn_handle);
My question:
Why does p_gap_evt->conn_handle value change for the same device after reconnecting? Shouldn't be that when I "occupy" connHandle=0, then "release" it so after next connection it would be used again instead of connHandle=1? Is it possible to force the chip to use only connH=0 and connH=1 for two connected devices?