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.

GAP_EstablishLinkRequest() and timeouts

it seems that GAP_EstablishLinkRequest() does not produce *some* event if the requested (peripheral) device does not respond to the link request from the central device initiating the transaction....  for example, were my requested device to have suddenly "gone away" then i would not (ever it seems) receive any event to "close out" the original call to EstablishLinkRequest()....

what's the proper way to handle this in my software???  clearly, i can have some sort of timeout of my own; but then what GAP function would i call to "cancel" the LinkRequest???  (similar to how discovery can be canceled)....  without telling the stack to "stop" connecting, i've found that it can actually succeed in establishing a link *way* in the future when the requested device comes back online....

  • If you have a "pending" establish link request that has not completed, you can call GAP_TerminateLinReq with connection handle 0xFFFE to cancel the establish link req.

  • Hi,

    Even i have a similar issue,  GAP_EstablishLinkReq( ) does not repond, when i try again it gives bleAlreadyInRequestedMode(0x11) return.

    and then it sits there forever, while it cannot connect to the device.

    Need help

    BR

    Gautam

  • My Central device connects to up to three peripherals. However the peripherals can be out of range alternately. A peripheral can move out of range between last scan result and attempt to connect. In such case the Establish link request must time out otherwise no notifications from already connected connected devices are received and no other in range devices can be connected to. I tried to use the GAP_TerminateLinReq with connection handle 0xFFFE to cancel the pending establish link req. but this terminates also an existing link.

    Is there any more reliable way to do it ?