I am trying to send data from a phone to the NRF51822. The data is being sent from the phone in 20 byte chunks to a write characteristic. When the event handler for receiving data is called, I use sd_ble_gatts_value_get() to get the data and copy it to a buffer. The problem I see is that part of the previous packet is returned instead of the current one, but it does have the right length. For example, if I sent 5 20-byte packets numbered 0 - 99, the first 60 would have the right number, but byte 61 might have the number 56 instead of 60. Are there any methods to improve data integrity over BLE?
Thanks!