Proper sequence to disconnect BLE

Hi Nordic team,

I'm using nRF52832, S132 with nRF5_SDK_17.1.0_ddde560 SDK. I want to send a packet with a notification to my smartphone and then disconnect immediately. I have implemented write notify and disconnect commands successfully. However, I want to know if I can call a command to write to characteristic with notify, and then call the command to disconnect BLE immediately? Does this risk any data loss? Or should I wait a bit until the packet has been sent successfully and then disconnect?

I also have another question that is a bit out of topic. But is there any way we can ensure a packet sent from the BLE peripheral to the smartphone is received properly and isn't dropped along the way? Our application requires no data loss during transfer. Is there any step we need to take or the default SoftDevice BLE handles all of this and ensure data will be resent if it doesn't go through successfully?

Best regards,

Xander

  • Hi Xander,

    Xander To said:
    I have checked out the link you sent. I believe that writing with the response is the property required to ensure no data loss when a smartphone wants to send data to the MCU, and reading with indication is the property required to ensure no data loss when the MCU sends data to a smartphone, am I correct?

    Yes

    Xander To said:
    Furthermore, if I want a smartphone or any client-side to read the data from MCU without polling, I must add notify properties to the characteristic. So in the end, I must use read notify indication characteristic?

    Indication also let the client read without polling. It just requires a response from the client in the next connection event and is therefore slower than Notification.

    Best regards,

    Hieu

Related