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

TP/SPE/BI-03-C [Client Characteristic Configuration Descriptor Improperly Configured]

We are trying to complete Bluetooth qualification on our Cycling Power Service (CPS) against the BluetoothRegistered Test Specification (Document Number CPS.TS.1.1.0).

We fail the test case:

TP/SPE/BI-03-C [Client Characteristic Configuration Descriptor Improperly Configured]

  • Verify that the IUT responds appropriately when a Client attempts to perform a Cycling Power Control Point procedure with a Client Characteristic Configuration descriptor that is improperly configured.

  • Reference [3] 3.4.3

  • Initial Condition

  • Perform the preamble described in Section 4.2.3.

  • Test Procedure

  1. A connection is established between the Lower Tester and IUT.
  2. The Lower Tester resets to 0 the Client Characteristic Configuration descriptor of the Cycling Power Control Point characteristic.
  3. The Lower Tester writes a valid Op Code to the Cycling Power Control Point.
  4. Verify the IUT response meets the requirements of the service.
  • Expected Outcome
    • Pass verdict
    • The IUT rejects the Write Request by sending an Error Response with an Attribute Protocol Error Code set to Client Characteristic Configuration Descriptor Improperly Configured (0xFD).

I try to send an error response to the tester by calling sd_ble_gatts_hvx().

This call fails with NRF_ERROR_INVALID_STATE because the CCCD is in the wrong state to indicate or notify.

How do I send an error response in this situation?

Parents
  • Hi,

    You can't send any notification/indication if the CCCD is not enabled.

    In this case you would need to set the authorization permission for write request to 1 (attr_md.wr_auth = 1). With that, the application can wait for the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event and select what it should give in the write response code (BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR 0x01FD in this case) and call sd_ble_gatts_rw_authorize_reply() to send the write response packet back.

    You can have a look at the ble_app_gls to find how we handle BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event. In your case you would need to check if CCCD is set or not before you send the reply back.

    You can have a look at this chart

    Without authorization, the softdevice will automatically response with SUCCESS code and update the value of the characteristic.

Reply Children
No Data
Related