about conn_handle maintain

nRF5_SDK_17.1.0

PCA10059

For I want to provide up to 20 central connections, I have defined the objects like this( inherited from example code):

GATEWAY_ARRAY_DEF(  
										m_gateway_array, 
										NRF_SDH_BLE_CENTRAL_LINK_COUNT);                    //< TGOI client instances. 

BLE_DB_DISCOVERY_ARRAY_DEF(
										m_db_disc_array, 
										NRF_SDH_BLE_CENTRAL_LINK_COUNT);                    //< Database discovery module instances. 

NRF_BLE_GQ_DEF(m_ble_gatt_queue,                                        //< BLE GATT Queue instance. 
               NRF_SDH_BLE_CENTRAL_LINK_COUNT,
               NRF_BLE_GQ_QUEUE_SIZE);


NRF_BLE_GATT_DEF(m_gatt);                                               //< GATT module instance. 

NRF_BLE_SCAN_DEF(m_scan);                                               //< Scanning Module instance. 

The conn_handle is the index to access arrays,that means for conn_handle ch,it's gateway instance is m_gateway_array[ch],it's discovery instance is m_db_disc_array[ch],and it's gatt queue is m_ble_gatt_queue[ch]. conn_handle is the primary key to access all object related to the connection defined by conn_handle.

And it is maintained by SD.

My question is : if one connection(conn_handle_A) broken(power off e.g.),and next BLE peripheral trying to connect after that,will SD allocate which conn_handle to this peripheral?

The reason to ask is may there are data left in m_ble_gatt_queue[conn_handle_A],I have to make choice on those data.

If the origal peripheral connected again with the same conn_handle,I can transfer those data to it again.

If a different peripheral connected with this conn_handle, wrong data will send to it .

I have to do some check work to clarify if the data left in queue belong to current instance or not.

That will be helpful if I can get some explaination on conn_handle.

Thank you.

Related