This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Accepted GATT status for write authorization reply?

I'm sending a write authorization reply using sd_ble_gatts_rw_authorize_reply() in response to a standard Write Request with one byte of data. When I set the gatt_status to BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED, the reply() function returns NRF_ERROR_INVALID_PARAM. However, if I set the gatt_status to BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED, the reply() function returns NRF_SUCCESS. The other parameters in the authorization reply are the same in both cases.

Is there a reason why BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED cannot be used?

More importantly, What are the valid GATT status codes than can be used for a write authorization reply? What are the valid GATT status codes for a read authorization reply?

I'm using S132 v2.0.1 and SDK 11.0.0 on the nRF52.

Thanks, Austin

Parents
  • In Vol. 3, Part F, Section 3.4.5.1 in the Bluetooth Core specification v4.2 it is stated:

    If the client has insufficient authorization to write the requested attribute then an Error Response shall be sent with the error code «Insufficient Authorization».

    This is the error code you shall use. I'm not sure why the SoftDevice allows you to use write not permitted. I'll have to check that with the developers, and update.

Reply
  • In Vol. 3, Part F, Section 3.4.5.1 in the Bluetooth Core specification v4.2 it is stated:

    If the client has insufficient authorization to write the requested attribute then an Error Response shall be sent with the error code «Insufficient Authorization».

    This is the error code you shall use. I'm not sure why the SoftDevice allows you to use write not permitted. I'll have to check that with the developers, and update.

Children
No Data
Related