This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to check the disconnected peripheral address in "BLE_NUS_C_EVT_DISCONNECTED" state

OS in development environment :Windows7
HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals
CPU :(Nordic) nRF52832 / ARMR Cortex?-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD
Soft Ver:nRF5_SDK_15.2.0_9412b96

How can I check the address of the peripheral that was disconnected in the "BLE_NUS_C_EVT_DISCONNECTED" state of the function "ble_nus_c_evt_handler"?
Thank you very much.

Parents
  • The peer address is not included in the "disconnect" event but is in the "connected"(BLE_GAP_EVT_CONNECTED) event. So you need to use the connection handle to determine which device was disconnected. You can, for instance, by expanding the ble_nus_c_evt_t event structure to include the peer address, then update the peer address on BLE_GAP_EVT_CONNECTED

Reply
  • The peer address is not included in the "disconnect" event but is in the "connected"(BLE_GAP_EVT_CONNECTED) event. So you need to use the connection handle to determine which device was disconnected. You can, for instance, by expanding the ble_nus_c_evt_t event structure to include the peer address, then update the peer address on BLE_GAP_EVT_CONNECTED

Children
Related