Replies: 1 comment 4 replies
-
This is user misconfiguration, you should not be using too large a packet that the remote device does not support, this is not related to the bluetooth transport, it will happen with them all. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
A quote from the spec:
That's true, it does guarantee ordered delivery, but it doesn't prevent packages from being dropped. The reassembly algorithm in zephyrs implementation simply drops the current(and all previous) fragments, when the data is larger than the length field of the SMP header. There are no sequence numbers, no checksums, no frame delimiter. Depending on the situation this can lead to mis-interpreting data as an SMP-header or vise-versa. In very unfortunate situations this may prevent you from recovering from that. In even worse situations, the loss goes undetected and what happens next is up to the SMP group handler .
Additional Info
The BLE core spec is very complex and unfortunately not very clear about if and when data loss is possible. There seem to be "ATT bearers"(=l2cap channels), which allow sending data with retransmissions disabled. It's not clear if and when they are used. For BLE notifications it seems to be clear that they don't have to be retries and can get lost though.
Either way, the spec only tells you what should happen until the stack receives the data. It can still be dropped within the stack or on the way to the application code. In fact, in zephyr that can happen all the time because there are many queues between HCI and the BLE API which happily drop data if they are full. While we could ofc, fix or configure that so it can't happen on zephyrs side, we can't control what the other side(the SMP client) looks like.
Beta Was this translation helpful? Give feedback.
All reactions