We are trying to complete Bluetooth qualification on our Cycling Power Service (CPS)
against the Bluetooth 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
- A connection is established between the Lower Tester and IUT.
- The Lower Tester resets to 0 the Client Characteristic Configuration descriptor of the Cycling Power Control Point characteristic.
- The Lower Tester writes a valid Op Code to the Cycling Power Control Point.
- 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?