When I do a sd_ble_gattc_char_value_by_uuid_read I can only get a maximum of 253 bytes.
And when I read more I get a gatt_status of
When I do a sd_ble_gattc_char_value_by_uuid_read I can only get a maximum of 253 bytes.
And when I read more I get a gatt_status of
Hi,
There does not seem to be any known issues of this nature, but I have reached out to the SoftDevice team. Since this is the nRF52840 and the SoftDevice API I assume this to be S140 v7.3.0, but it would be great to get it confirmed moving forward.
Thank you for sharing the workaround. Does this solve the issue for you, or does the project also require use of larger max MTU size?
Regards,
Terje
Hi,
I have a couple of questions from the team:
1. Are you using an nRF device in both ends?
2. Can you please provide a sniffer trace (nRF Sniffer or otherwise), for us to look into what is happening over the air?
If you cannot provide this in the open, then please create a private ticket, refer to this one, and attach the sniffer trace (or any other confidential information) there.
Regards,
Terje
i am using the v7.2.0 soft device. and the other side is my phone pixel 7A with the nrf connect
wireshark direct mtu 257 .pcapngwireshark direct mtu 512 .pcapng
Took me somewile to make the logs.
Hi,
Thank you for the additional information.
We have found that there is acutally an upper limit of 253 bytes in the Bluetooth specification. Bluetooth Core specification 5.4, vol 3, part F, section 3.4.4.2 ATT_READ_BY_TYPE_RSP:
The attribute handle-value pairs shall be set to the value of the attributes identified by the attribute type within the handle range within the request. If the attribute value is longer than (ATT_MTU - 4) or 253 octets, whichever is smaller, then the first (ATT_MTU - 4) or 253 octets shall be included in this response.
This means your implemented workaround would be the correct way to read longer values.
Regarding the BLE_GATT_STATUS_ATTERR_INVALID there might still be a bug in the SoftDevice, as it sounds a bit strange this error should pop up if trying to read longer values. If anything you should get (ATT_MTU - 4) or 253 octets back (whichever is smaller), if the value is longer than that.
Regards,
Terje