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
  • I'm using "request not supported" as a response when the server is in a "bad" state and does not allow the characteristic to change. But that is a good point, "request not supported" is probably more narrowly defined like you described. I should probably use an application-specific error code for this particular case.

    Still, if the SoftDevice is going to return an error, it would be nice for the documentation to list which status codes will cause an error.

Reply
  • I'm using "request not supported" as a response when the server is in a "bad" state and does not allow the characteristic to change. But that is a good point, "request not supported" is probably more narrowly defined like you described. I should probably use an application-specific error code for this particular case.

    Still, if the SoftDevice is going to return an error, it would be nice for the documentation to list which status codes will cause an error.

Children
No Data
Related