kai-morich / SimpleBluetoothLeTerminal

Android terminal app for Bluetooth LE devices using custom serial profiles
MIT License
290 stars 111 forks source link

only receiving 20 bytes at a time #19

Open Zapnologica opened 3 years ago

Zapnologica commented 3 years ago

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?

kai-morich commented 3 years ago

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.

Zapnologica commented 3 years ago

I see that is very interesting.

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

kai-morich commented 3 years ago

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