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 timeout

I was wondering if it possible to configure the BLE stack so that a call to GAP_EstablishLinkRequest times out after a set number of seconds if it can't make a connection. At the moment it seems that the GAP_EstablishLinkRequest sits there forever until it is able to connect to the device and then sendsGAP_LINK_ESTABLISHED_EVENT. I would like if the GAP_LINK_ESTABLISHED_EVENT is send after a timeout and with a timout error

I want to connect to two slaves simultaneously, and if I call GAP_EstablishLinkRequest twice for each device the second call fails. It seems I have to wait for the first one to connect and then call GAP_EstablishLinkRequest for the second device. The problem is now when I call GAP_EstablishLinkRequest for the first device and this device is not reachable, then it sits there forever and I can't connect to the second device until the first one is connected. Any help would be very much appreciated.

Regards

Reto

 

 

 

  • Hello,

    The establish procedure is a trigger mechanism on the master.  The addess is loaded, and then the controller will automatically send connectionReq when the advertisement from that address comes in. 

     

    If you are trying to connect to slaves A and B, the procedure will have be

    -Scan for both ( scanning is not supported once connected)

    - Connect to A

    - Connect to B 

    If A fails, and you don't want to wait, then try sending a GAP_TerminateLinkRequest with connection handle 0XFFFE - this will cancel the connectionReq, and you can then proceed to connect to B.

    [77] : <Tx> - 08:27:08.955

    -Type : 0x01 (Command)

    -Opcode : 0xFE0A (GAP_TerminateLinkRequest)

    -Data Length : 0x02 (2) byte(s)

     ConnHandle : 0xFFFE (65534)

    Dump(Tx):

    01 0A FE 02 FE FF 

     

    Also, check the 1.1 readme for limitations on mutiple connections. 

     

    BR,

    -Greg