This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ATT_FLOW_CTRL_VIOLATED_EVENT sequence

Other Parts Discussed in Thread: CC2650

Hi,

on cc2650 using 

Using ble_cc26xx_2_01_00_44423

I am experiencing hangs due to air interference on a link that is using indications and trying to understand how to gracefully bring the link up again. 

I would like to ask a question on flow of messages.

I would like to ask if it is possible that a  GAP_LINK_TERMINATED_EVENT 

is recieved prior to ATT_FLOW_CTRL_VIOLATED_EVENT .

if I understand correctly ATT_FLOW_CTRL_VIOLATED_EVENT could be sent to the application after 30secs of retries. (My application is using indication mechanism).

1. Since it is very hard to simulate this scenario I would like to know what are the possible sequences of these messages:

ATT_FLOW_CTRL_VIOLATED_EVENT then GAP_LINK_TERMINATED_EVENT ?

GAP_LINK_TERMINATED_EVENT then  ATT_FLOW_CTRL_VIOLATED_EVENT ?

2. I would like to verify If I this call is valid, my code

...

if (pMsg->method == ATT_FLOW_CTRL_VIOLATED_EVENT)
{

Note: srvrChId could not exist if GAP_LINK_TERMINATED_EVENT is called prior to ATT_FLOW_CTRL_VIOLATED_EVENT

uint8_t srvrChId = connection_handler_server_channel_get(pMsg->connHandle);

if(srvrChId != 0xFF)

{

//Have to terminate connection
GAPRole_TerminateConnection(pMsg->connHandle);

}

}

Thanks

Tamir

  • Hello Tamir,

    The ATT_FLOW_CTRL_VIOLATED_EVENT is sent to the app when the Client (peer) has violated the ATT flow control requirements, such as sending a Read Request before an Indication Confirm is sent. A GAP_LINK_TERMINATED_EVENT is unrelated, but can be received at any time during the connection.

    Best wishes
  • Hi thanks,

    I understand.

    So I might have misunderstood when ATT_FLOW_CTRL_VIOLATED_EVENT is sent to the app(Server). 

    I thought ATT_FLOW_CTRL_VIOLATED_EVENT was sent when a confirmation wasnt received.

    So I will clarify my question:

    Question

    Is there a message\event  sent  to the app runing as a Server that recently sent an indication, stating a confirmation hasnt been recieved (transaction failed as specified in BLE core spec.)  or is the only message I will recieve is GAP_LINK_TERMINATED_EVENT, since this is the only case a confirmation wont be recieved?.

    I want to know if I should add any error handling to terminate the link as I mistakenly did under ATT_FLOW_CTRL_VIOLATED_EVENT . 

    As described in BLE Spec.

    "On a server, a transaction shall start when an indication is sent by the server. A
    transaction shall complete when the confirmation is received by the server."

    "A transaction not completed within 30 seconds shall time out. Such a transaction

    shall be considered to have failed and the local higher layers shall be
    informed of this failure. No more attribute protocol requests, commands, indications
    or notifications shall be sent to the target device on this ATT Bearer.
    Note: To send another attribute protocol PDU, a new ATT Bearer must be
    established between these devices. The existing ATT Bearer may need to be
    disconnected or the bearer terminated before the new ATT Bearer is established."

    Thanks

    Tamir

  • Hello Tamir,

    If the server doesn't receive a confirm to the Indication procedure within 30 secs, then a GATT_MSG_EVENT will be sent to the app for the ATT_HANDLE_VALUE_CFM with bleTimeout as the status. The stack will inhibit all further ATT operations when this occurs for this connection handle, however, the stack will not terminate the link on your behalf. Your app may elect to terminate the link when notified of this event. The termination behaviour is the same for the ATT_FLOW_CTRL_VIOLATED_EVENT.

    I apologize if this is not clear in our documentation, I'll see if it can be added in a future update.

    Best wishes
  • Thanks a lot.

    Tamir