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

Related