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 Establish Link Request status codes

Hi,

I'm seeing a command status event for GAP Establish Link Request command with a status code of 0x11.  Does anyone know what this code means?  It is not specifically documented for the command in the Vendor Specific HCI documentation.

Thanks

-Tyler

  • Hi Tyler,

    Looking in the TI BLE API Guide (included in the stack installer), it seems like the status code 0x11 is  "bleAlreadyInRequestedMode" which basically means that the device is already performing this task.

    Br

  • Hi Nick,

    Thanks for the response.  That seems to answer my initial question, but now I need to figure out how it got in this state.  Here is the scenario:

    1 - Execute example program using 2540 keyfob, connect to peer device, send some data, tear down the link ( GAP_TERMINATE_LINK_REQUEST) and exit the application.

    2 - Start execution of example program again, attempt to connect to a _different_ peer device, and receive status 0x11 from the GAP_Establish_Link_Request command.  At this point, the keyfob is stuck in this state, all subsequent GAP_Establish_Link_Request commands result in status 0x11.  The only thing that seems to clear it is a hard reset (unplug keyfob, plug it back in).  

    I have tried issuing an explicit HCI_Reset.  It returns successfully, but the keyfob is still stuck returning 0x11 for GAP_Establish_Link_Request.  For this reason, I suspect that there is some connection state issue in the protocol stack layer.  The UTIL_Reset for hard reset command is not an option for me - using windows, the comm port gets re-assigned and my application can no longer communicate with the keyfob.  This only happens when I try to connect to a different peer device in step 1 and step 2.  If I connect to the same peer device, I do not see the issue.  

    Any ideas?  Is there any other step besides sending the GAP_Terminate_Link_Request (sending with 0xFFFF handle mask to terminate all links) I need to take to completely tear down the link?

    Thanks for your help,

    -Tyler

  • FWIW, I am able to work around the issue by issuing an explicit GAP_Link_Terminate_Request with 0xFFFE as the handle mask when the application starts and exits. 

    -Tyler