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

Handling two indications simultaneously

Hello all, I have two services which has characteristics with indication only property. I am using sensor simulator to generate values. When i write first CCCD write of one characteristic it indicates properly. But when write second CCCD (first CCCD still has value of indication) i get error NRF_ERROR_BUSY. Should I write first CCCD value to zero? Is there any approach for handling simultaneous indications?

Parents
  • An Indication needs to be confirmed before the next indication can be sent. This is a requirement of the Bluetooth specification in the Attribute protocol. See volume 3 part F, section 3.4.7

    The client shall send a Handle Value Confirmation in response to a Handle Value Indication. No further indications to this client shall occur until the confirmation has been received by the server. Blockquote

    To handle this correctly: Write to the CCCDs to enable indications. Send the first Indication However do not send the next Indication until the Confirmation of the first Indication has arrived.

    nRF8001: The Confirmation is received as the ACI DataAck Event (Section 27 Data events in nRF8001 datasheet)

    nRF51822: The Confirmation is received as the event BLE_GATTS_EVT_HVC

    In any case since you do not seem to care about the Confirmation I would suggest that you use Notifications. When sending any data using Notifications you will get a radio level acknowledgement (as the Bluetooth radio provides a reliable link). Notifications are not acknowledged at the Atttribute protocol layer, so they can be sent at any time so long as the transmitting radio has the buffer available, they get the radio level acknowledgement that every Bluetooth packet transmitted receives.

    The radio level acknowledgements are provided as ACI Data Credit Event in the nRF8001 IC. In the nRF51822 IC the radio level acknowledgements are provided with the BLE_EVT_TX_COMPLETE

Reply
  • An Indication needs to be confirmed before the next indication can be sent. This is a requirement of the Bluetooth specification in the Attribute protocol. See volume 3 part F, section 3.4.7

    The client shall send a Handle Value Confirmation in response to a Handle Value Indication. No further indications to this client shall occur until the confirmation has been received by the server. Blockquote

    To handle this correctly: Write to the CCCDs to enable indications. Send the first Indication However do not send the next Indication until the Confirmation of the first Indication has arrived.

    nRF8001: The Confirmation is received as the ACI DataAck Event (Section 27 Data events in nRF8001 datasheet)

    nRF51822: The Confirmation is received as the event BLE_GATTS_EVT_HVC

    In any case since you do not seem to care about the Confirmation I would suggest that you use Notifications. When sending any data using Notifications you will get a radio level acknowledgement (as the Bluetooth radio provides a reliable link). Notifications are not acknowledged at the Atttribute protocol layer, so they can be sent at any time so long as the transmitting radio has the buffer available, they get the radio level acknowledgement that every Bluetooth packet transmitted receives.

    The radio level acknowledgements are provided as ACI Data Credit Event in the nRF8001 IC. In the nRF51822 IC the radio level acknowledgements are provided with the BLE_EVT_TX_COMPLETE

Children
No Data
Related