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

disconnecting while operations are in progress never gives BLE_GAP_EVT_DISCONNECTED event

2020-01-24-092119EST-ProductStoppedGettingEventsFromNordicDK.txtImprivataTestNordicEventsNotReceived.zipCalls_to_pc_ble_driver.cpp0285.2020-02-24-TestProgramUploadedToNordicSupport.zipFeb25TestProgramUploadedToNordicSupport.zipImprivata_bgTestApp.zipbgSDKTestAppMay4.zip2020-05-05-035347-NordicDK_USB840M_200505_ClockInternal_2in1.hex.txt.txtbgSDKTestAppMay6.zipI’m developing an application based on pc-ble-driver to talk to an nRF52840-based dongle (from Fanstel).

I’m having trouble disconnecting cleanly when a connection has operations in progress.  For example, I call ‘sd_ble_gattc_write’, which returns NRF_SUCCESS, but I don’t receive event BLE_GATTC_EVT_WRITE_RSP (after waiting 60 seconds), so I decide to disconnect. When this happens, sd_ble_gap_disconnect returns NRF_SUCCESS, but I do not receive BLE_GAP_EVT_DISCONNECTED even after waiting 30 seconds. The connection supervision timeout is 4 seconds.  What could cause the disconnect to not generate any BLE_GAP_EVT_DISCONNECTED event?

What I’m trying to accomplish here: if a connection is not responsive, I want to end that connection, without disturbing other connections I have open.

Thanks,

Paul Bradford

Parents
  • I think you may be mixing the two events BLE_GAP_EVT_TIMEOUT and BLE_GATTC_EVT_TIMEOUT. GAP is most likely the event that is handled in your sample application and is valid for connection requests and scan timeouts (also advertising timeouts in peripheral applications).

    I received confirmation from our softdevice team that the GATTC timeout can be generated in case of no response to sd_ble_gattc_write call.

    I will convert this case to a private on request from David Martin. If you are able to reproduce the issue on the nRF52840 Dongle, we can help you to enable logging or debugging capabilities. I'm assuming you are using the USB transport for the connectivity firmware, which means that logging may need to be done over UART with a USB to UART bridge since the USB interface is "occupied" by serialization library. 

Reply
  • I think you may be mixing the two events BLE_GAP_EVT_TIMEOUT and BLE_GATTC_EVT_TIMEOUT. GAP is most likely the event that is handled in your sample application and is valid for connection requests and scan timeouts (also advertising timeouts in peripheral applications).

    I received confirmation from our softdevice team that the GATTC timeout can be generated in case of no response to sd_ble_gattc_write call.

    I will convert this case to a private on request from David Martin. If you are able to reproduce the issue on the nRF52840 Dongle, we can help you to enable logging or debugging capabilities. I'm assuming you are using the USB transport for the connectivity firmware, which means that logging may need to be done over UART with a USB to UART bridge since the USB interface is "occupied" by serialization library. 

Children
No Data
Related