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,
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
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
Tanks Terje,
in de wireshark logs 512, I can not see any data that has been send. Is this also a bug in de nrf android app? or is this bug in de android ble stack?
Hi
Sorry about the late reply here, but I think the maximum supported MTU size for BLE on Android devices is also 255 (or 252 in reality), so I assume that is why the Wireshark log reflects that the Android devices sees a unknown GATT (generic attribute).
Best regards,
Simon