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.

HCI Tester bleAlreadyInRequestMode error

Other Parts Discussed in Thread: CC2540

I have used BTool to communicate with my BLE device to much success for practice. I am now using a python script to act as my client to talk to the same BLE device. I first am using HCI Tester to slowly build the scripts I want to eventually include in my app, but just want to make sure I can do simple connection, read etc within the HCI Tester application.

I can successfully do the following:

  1. GAP_DeviceInit
  2. GAP_GetParam
  3. GAP_DeviceDiscoveryRequest

That is where my luck ends.

When I discover I can see the address of my device is the same as observed in BTool. Use that address to then call GAP_EstablishLinkRequest but I keep getting either error status 0x11 "bleAlreadyInRequestedMode" and I've tried entering the peerAddr for the establishLinkRequest in both little endian, big endian with no luck.

  • I must have somehow locked up the HCI because when I tried BTool to establish connection I got the same "AlreadyInRequestedMode." I think part of the problem is our peripheral device automatically disconnects but maybe somewhere I tried reconnecting before it had a chance to disconnect after x number of seconds. So within that window I kept re-establishing. Either way figured it out.

    Redacted.

  • So although I feel I understand the issue at hand what confuses me now is my device doesn't seem to be telling the client that the connection has ended. On top of that even when I send the GAP_TerminateRequest and try to re-establish moments later I still see the "bleAlreadyInRequestMode" error.

  • Hello. You are clearly somehow already attempting to connect when you send GAP_EstablishLinkRequest. Have you tried using GAP_TerminateRequest with handle 0xFFFE (cancel current link estabsishment request) or 0xFFFF (Terminate all links).

    Are you attempting to write your own host here? The reason I ask is because it is rather complicated to develop a network processor project using the HCI layer and we do not provide much support for this.

    A more common solution here is to use an embedded central project (such as simpleBLECentral) and add a custom SPI / UART driver to transfer necessary information to your other MCU.
  • No, I'm using something I found using python which works with the HostReleaseAll project loaded on the CC2540. I'm just trying to correctly use the commands.

    Its interesting you say I am connecting in some way because once I unplug the dongle to reset things and then establish a link and try to do a read I get a status 0x02 "InvalidParameter" error using BTSIG characteristic 2A:26 for checking just FW I tried both little and big endian here as well.

    I will try your terminate suggestion first to see if I can at least get that to work.
  • Thanks Tim. Your suggestion to Terminate using 0xFFFE or 0xFFFF did the trick. Once I terminated all links I simply re-ran what I have and was able to finally read the FW version. Kudos!