Nordic NUS - uart service; both SDK 15.3 and 17.0.2. Packet loss on repeated BLE disconnect - connect cycles; seeking clarification of my understanding.
"If there are untransmitted packets in the TX buffer where there is a disconnect, those packets will be lost. So, those packets will not be transmitted automatically upon a re-connect. Upon a re-connect, if needed, the packets will have to be put manually into the TX buffer."
How is this best handled, ie how do we know which packets are in the Tx buffer and which have been sent over BLE and removed. TX_COMPLETE is clearly not a good indication; does this require a specific BLE_GATTC_EVT_WRITE_RSP check for every packet, followed by a retransmit if none received but a BLE disconnect takes place?
// BLE_GAP_EVTS - GAP Event IDs - uniquely identify an event coming from the stack to the application
// BLE_GATTC_EVTS - GATT Client Event IDs
/* BLE_GATTC_EVT_WRITE_RSP: */ "56 Write Response event",
Packets are (say) 160 bytes; loss is typically one or two packets per BLE connect/disconnect cycle, assuming BLE connect/disconnect cycle is the cause; typically 1GByte total transmission.
The question is probably best posed as is the BLE TX buffer discarded regardless of contents on a BLE disconnect event? If so that is not what I expected .. anyone tried working around this?