I've been trying to get my head around using a BLE central and making connections so I've loaded up the multi-central example to figure out just how everything works. I turned on the App Trace Log to try to get a feel for what's happening behind the scenes, and this is what it produces when the device starts and a peripheral is connected.
[DM]: >> dm_init.
[DM]: Initializing Application Instance 0x00000000.
[DM]: Initializing Connection Instance 0x00000000.
[DM]: Initializing Connection Instance 0x00000001.
[DM]: Initializing Connection Instance 0x00000002.
[DM]: Initializing Connection Instance 0x00000003.
[DM]: Initializing Connection Instance 0x00000004.
[DM]: Initializing Connection Instance 0x00000005.
[DM]: Initializing Connection Instance 0x00000006.
[DM]: Initializing Connection Instance 0x00000007.
[DM]: Initializing Peer Instance 0x00000000.
[DM]: Initializing Peer Instance 0x00000001.
[DM]: Initializing Peer Instance 0x00000002.
[DM]: Initializing Peer Instance 0x00000003.
[DM]: Initializing Peer Instance 0x00000004.
[DM]: Initializing Peer Instance 0x00000005.
[DM]: Initializing Peer Instance 0x00000006.
[DM]: Initializing Peer Instance 0x00000007.
[DM]: Storage handle 0x0003F800.
[DM]:[0x00]: Block handle 0x0003F800.
[DM]:[DI 0x00]: Device type 0x01.
[DM]: Device Addr 0xB6 0xAF 0x51 0x4F 0xEE 0xD5.
[DM]:[0x01]: Block handle 0x0003F844.
[DM]:[DI 0x01]: Device type 0xFF.
[DM]: Device Addr 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM]:[0x02]: Block handle 0x0003F888.
[DM]:[DI 0x02]: Device type 0xFF.
[DM]: Device Addr 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM]:[0x03]: Block handle 0x0003F8CC.
[DM]:[DI 0x03]: Device type 0xFF.
[DM]: Device Addr 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM]:[0x04]: Block handle 0x0003F910.
[DM]:[DI 0x04]: Device FF.
[MAFF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM]:05]cx0003F954.
[DM]05] eFF.
[cFF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM]:06] l0003F998.
[DM] 06]tFF.
[D FF 0xFF 0xFF 0xFF 0xFF 0xFF.
[DM][07]h0003F9DC.
[DM]:07]ixFF.
MAFF 0xFF 0xFF 0xFF 0xFF 0xFF.
ble_evt: [DM]: Request to allocation connection instance
[DM]:[00]: Connection Instance Allocated.
[DM]: Searching for device 0xB6 0xAF 0x51 0x4F 0xEE 0xD5.
[DM]:[DI 0x00]: Device type 0x01.
[DM]: Device Addr 0xB6 0xAF 0x51 0x4F 0xEE 0xD5.
[DM]: Found device at instance 0x00
[DM]:[00]:[Block ID 0x0003F800]:Loading bond information at 20002ec0, size 0x0000001C, offset 0x00000018.
[DM]:[0x00]:[0xFF]: Bond context Event
[DM]: Notifying application of event 0x21
[APPL]:[0x00] >> DM_EVT_LINK_SECURED
[APPL]:[0x00] << DM_EVT_DEVICE_CONTEXT_LOADED
[DM]:[00]:Loading service context at 20002fa0, size 0x0000000C, offset 0x00000034.
[DM]: --> gattc_context_load
[DM]: Notifying application of event 0x11
[APPL]:[0x00] >> DM_EVT_CONNECTION
[APPL]:[B6 AF 51 4F EE D5]: Connection Established
[APPL]:[CI 0x00]: Requesting GATT client create
[DB]: Starting discovery of service with UUID 0x9001 for Connection handle 0
[APPL]:[0x00] << DM_EVT_CONNECTION
ble_evt: ble_evt: ble_evt: ble_evt: [DB]: Discovery of service with UUID 0x9001 completed with success for Connectionhandle 0
ble_evt: [DM]: >> dm_security_setup_req
[DM]: << dm_security_setup_req, 0x00000000
ble_evt: [DM]: >> BLE_GAP_EVT_CONN_SEC_UPDATE, Mode 0x01, Level 0x02
[DM]: --> gattc_context_apply
[DM]: Notifying application of event 0x15
[APPL]:[0x00] >> DM_LINK_SECURED_IND, result 0x00000000
[APPL]:[0x00] << DM_LINK_SECURED_IND
So I understand DM is the Device manager, DB is the database and APPL is just the app logging miscellaneous events. A lot of the finer deatils like the block handle and service context I'm clueless about.
But what are the roles of the Device Manager and Database?
Where is the connection information stored and how can it be accessed?
How are the connections maintained?
I found the documentation on the example, but it's more about the setup and test than the software.... Is there any more detailed explanation of this software example? For many examples all you get is code and very little explanation which unfortunately doesn't make for a great learning resource.