WurthElektronik / WirelessConnectivity-SDK_STM32

Software development kit for Würth Elektronik eiSos wireless connectivity products (implementation for STM32 microcontrollers).
Other
7 stars 6 forks source link

Disconnect when received characteristic data > 128 bytes #11

Closed alexbrickwedde closed 2 days ago

alexbrickwedde commented 2 weeks ago

Hi,

i'm sending from Android via: int statusCode = gatt.writeCharacteristic(writecharacteristic, value, BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);

If value is longer than 128 bytes (the standard allows 512), i get disconnect events from Stephano-I ("<<" is incoming serial data). Sometimes Stephano-I just stops sending event notifications.

<<+WRITE:0,1,1,,192,b65d30030c88b44c975a343f93fb3c09e7d37fe193c03bf995c81ed070304d892f7cf7aca1b87cd03c63112e4b2b4056fd26af975ef38316cbbb8a804218470a097447a5042d21b5be0a592e932117e9a1d8fbca8ec3224949cd48380a9b2f18
Write event received.
 Connection index: 0
 Service index: 1
 Characteristic index: 1
 Descriptor: 0
 Length: 192
<<+BLEDISCONN:0,"72:b3:bb:b7:5c:83"

Regards

...Alex

mah-eiSmart commented 2 weeks ago

Hi Alex, thank you for the feedback. The characteristic allows to exchange 128 bytes max. It's defined in the characteristic. Same holds for the TX-characteristic. BR Matthias

alexbrickwedde commented 2 weeks ago

Hi Alex, thank you for the feedback. The characteristic allows to exchange 128 bytes max. It's defined in the characteristic. Same holds for the TX-characteristic. BR Matthias

Is there any way to transmit up to 512 bytes in one packet? Otherwise i'll have to split. (Can i assume send order is the same as receive order?)

mah-eiSmart commented 2 weeks ago

Splitting has to be done, yes. Send and receive order are the same. More hints:

mah-eiSmart commented 1 week ago

@alexbrickwedde, we verified our tests with the transmission of large packets of up to 512 bytes, and it was working fine. Please find the log here:

log.txt

Please note that MTU is set to 517 bytes during connection setup, before subscribing to the notification. That may be the difference to your test.

alexbrickwedde commented 2 days ago

Please note that MTU is set to 517 bytes during connection setup, before subscribing to the notification. That may be the difference to your test.

That was the difference, works now. Thank you.