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

how can I clear pending indication

in the answer of this question it said that :

You are also not allowed to send a new indication until the previous one is confirmed. This is signaled by the reception of a BLE_GATTS_EVT_HVC (handle value confirmation) event.

how about when I disable indication on phone side when peripheral send indication? the indication wont be confirmed. how can I set previous one manually to be confirmed, so that I can ignore it and send new indication. note that i need to use indication instead of notifications.

or is there any indication timeout event triggered????

  • As I said in the other thread where you asked basically the same thing, if the indication goes out, it will be confirmed, if the indications have been disabled, you will get an invalid state and it won't go out. The situation you are asking about doesn't exist.

    And why do you need to use indication instead of notification? Rarely do you need an application-level ack of an indication. Are you sure you need them, or do you have a misconception about the reliability of notifications?

  • FormerMember
    0 FormerMember

    As also commented in this question, it is not possible to transmit indications (or notifications) when it is disabled.

    Indications (and notifications) are enabled/disabled by writing to its CCCD. It is up to the application to keep track of that. In the example ble_app_uart, the struct ble_nus_t has the member "is_notification_enabled", it keeps track of if notification is enabled or not.

    Note that the only difference between indications and notifications is that when using indications the client has to confirm the reception from the application layer, before a the server can transmit a new indication. When using notification, the packets are ACKed in the link layer, so there should not be any data loss. I would recommend you to take a look at this post, it also discusses notifications vs indications.

Related