Hi All
I have a system with two PCA10040 boards both running with SD version s132_nrf52_6.1.0. The application is build with SDK version 15.2.
I have implemented a peripheral device on one board, and a central device on the other. I have designed a custom service for transporting data in both directions. Two characteristics for notifying data from the peripheral, and two characteristics for writing data in the opposite direction. Everything got the expected functionality.
The application requires a minimal connection sequence time.
In the setup the connection time measured from advertising to the first data are transmitted through the characteristic. In the setup described above, it takes around 1.5 seconds for reconnecting two previous bonded devices.
I have optimized the setup by reducing the number of characteristics to a single one, at it gave a little reduction. But nothing serious.
I have added some extra debug information in the logging.
Log from peripheral:
[00:02:00.004,150] <info> app: Fast advertising. [00:02:00.064,208] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_PARAMS_REQ [00:02:00.064,208] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:02:00.064,208] <info> app: pm_evt_handler: PM_EVT_BONDED_PEER_CONNECTED [00:02:00.064,208] <info> app: pm_evt_handler: EventId=14 [00:02:00.064,208] <debug> app: on_connect: 0x00 [00:02:00.064,208] <info> app: Connected. [00:02:00.095,947] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:02:00.245,849] <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption [00:02:00.245,849] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:02:00.245,849] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:02:00.245,849] <debug> app: AppBleStateSet: APP_BLE_STATE_CONNECTED [00:02:00.245,849] <debug> app: AppDisconnectHandler: Security status: c=1, e=1, m=0, b=1 [00:02:00.395,996] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:02:00.545,654] <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption [00:02:00.545,654] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:02:00.545,654] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:02:00.545,654] <debug> app: AppDisconnectHandler: Security status: c=1, e=1, m=0, b=1 [00:02:00.995,605] <debug> app: on_char_cccd_write: len=2 0x01 0x00 [00:02:00.998,535] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:02:01.115,966] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:02:01.265,869] <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption [00:02:01.265,869] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:02:01.265,869] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:02:01.265,869] <debug> app: AppDisconnectHandler: Security status: c=1, e=1, m=0, b=1 [00:02:10.245,849] <info> app: AppDisconnectHandler: Started [00:02:12.245,361] <debug> app: on_disconnect: 0x00 [00:02:12.245,361] <info> app: Disconnected.
Log from central:
[00:00:00.002,929] <debug> ble_scan: Scanning [00:00:00.113,281] <info> app: scan_evt_handler: NRF_BLE_SCAN_EVT_WHITELIST_ADV_REPORT: F6:7F:4C:04:7F:2B [00:00:00.113,281] <info> app: scan_evt_handler: Adv data: len=24 [00:00:00.113,281] <info> app: scan_evt_handler: Adv data: manuf_id=0xBEAF [00:00:00.113,281] <debug> app: Input received k=0x00 j=0x00 p=0 [00:00:00.113,281] <debug> ble_scan: Connecting [00:00:00.113,281] <debug> ble_scan: Connection status: 0 [00:00:00.206,787] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_PARAMS_REQ [00:00:00.206,787] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:00:00.206,787] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:00:00.206,787] <info> app: pm_evt_handler: PM_EVT_BONDED_PEER_CONNECTED [00:00:00.206,787] <info> app: pm_evt_handler: EventId=14 [00:00:00.206,787] <info> app: Connected. [00:00:00.206,787] <debug> ble_db_disc: Starting discovery of service with UUID 0x1 on connection handle 0x0. [00:00:00.209,960] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_PARAMS_REQ [00:00:00.209,960] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:00:00.209,960] <info> app: pm_evt_handler: EventId=18 [00:00:00.289,062] <debug> ble_db_disc: Found service UUID 0x1. [00:00:00.510,986] <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption [00:00:00.510,986] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:00:00.510,986] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:00:00.811,035] <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption [00:00:00.811,035] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:00:00.811,035] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:00:00.930,908] <debug> ble_db_disc: Discovery of service with UUID 0x1 completed with success on connection handle 0x0. [00:00:00.930,908] <debug> ble_db_disc: Starting discovery of service with UUID 0x180A on connection handle 0x0. [00:00:00.990,966] <debug> ble_db_disc: Found service UUID 0x180A. [00:00:01.230,957] <debug> ble_db_disc: Discovery of service with UUID 0x180A completed with success on connection handle 0x0. [00:00:01.230,957] <debug> app: Service discovered at peer. [00:00:01.230,957] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_PARAMS_REQ [00:00:01.230,957] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_START [00:00:01.230,957] <debug> app: Configuring CCCD. CCCD Handle = 14, Connection Handle = 0 [00:00:01.230,957] <debug> app: SD Read/Write API returns Success. [00:00:01.230,957] <info> app: Service discovered. [00:00:01.230,957] <debug> ble_dis: SD is currently busy. This request for Client Read procedure will be attempted again. [00:00:01.230,957] <info> app: Device Information Service discovered. [00:00:01.230,957] <debug> ble_dis: SD is currently busy. This request for Client Read procedure will be attempted again. [00:00:01.291,015] <debug> ble_dis: SD Read/Write API returns Success. [00:00:01.531,005] <info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption [00:00:01.531,005] <info> app: pm_evt_handler: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED [00:00:01.531,005] <info> app: pm_evt_handler: PM_EVT_CONN_SEC_SUCCEEDED [00:00:01.591,064] <info> app: [00:00:01.591,064] <info> app: Device Information: [00:00:01.591,064] <info> app: PnP ID: [00:00:01.591,064] <info> app: Vendor ID Source: 0x01 [00:00:01.591,064] <info> app: Vendor ID: 0x0059 [00:00:01.591,064] <info> app: Product ID: 0x0001 [00:00:01.591,064] <info> app: Product Version: 0x0002 [00:00:01.591,064] <info> app: [00:00:01.591,064] <debug> ble_dis: Received correct read response. [00:00:12.510,742] <info> app: Disconnected. conn_handle: 0x0, reason: 0x15
Does anyone have an idea if it is possible to reduce the connection time?
Regards Kasper