SimpleBluetoothLeTerminal icon indicating copy to clipboard operation
SimpleBluetoothLeTerminal copied to clipboard

only receiving 20 bytes at a time

Open Zapnologica opened this issue 5 years ago • 3 comments

Good day,

I am using your code library. (Thank you by the way for this, very helpful)

however I am having an issue when I get larger responses like 60bytes etc, the receive callback is only getting a byte array of 20 characters?

What could be causing this?

Zapnologica avatar Jan 20 '21 05:01 Zapnologica

the default BLE payload size is 20 byte. Only some devices can handle larger size. This is negotiated during connection setup. Longer data is split into appropriate chunks.

kai-morich avatar Jan 20 '21 07:01 kai-morich

I see that is very interesting.

Does the serial socket not buffer those 20byte segments back into a complete packet?

Zapnologica avatar Jan 20 '21 09:01 Zapnologica

the bluetooth stack only knows about these 20byte packets. you have to reconstruct your logical request by knowing your protocol

kai-morich avatar Jan 20 '21 12:01 kai-morich