My Particle Argon is running as a BLE central device (running OS 6.2.0). It loses bytes when it asks a 3rd party peripheral to send a packet that is greater than 244 bytes. To be more precise, it drops exactly every 245th byte during the reception of a packet that was sent using fragmentation.
Background: I have a 3rd party BLE peripheral device by a company named Shelly which I poll for status. I initially used a Python script under Linux on a PC to poll it and I receive the exact number of bytes each poll (message length=774).
When I use my Argon to poll for the same data, when I read the response, I get the following return:
uint8_t rxb[1024];
int r,n = 0, len=774;
while { (r = (BleCharacteristic)pRx.getValue(&rxb[n], len-n)) > 0)
Serial.println(r);
n += r;
}
Serial.println(n);
tty output:
244
244
244
39
771
i.e. after these reads, n=771 every time.
When i compare the Argon's received bytes to the Python PC script's, each 245th byte is missing. This looks like a simple bug in the portion of the Particle BLE stack that deals with fragmentation.
I decided to re-create this problem by making my Photon2 a BLE peripheral that responds just like the Shelly device; however, that failed since the maximum packet length to send (setValue()) is limited to 244. I tried..
As it happens, this is not a critical problem for me since the bytes lost don't have any impact on my setup's operation (the lost bytes are only cosmetic).
I'm more that happy to help further with anything on this issue.