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.

Disconnected reason 22 BLE

Other Parts Discussed in Thread: CC2650

I am trying to connect CC2650 Simple BLE Central application code with some non TI peripheral solutions to check inter operability.

 Peripherals are detected and connected properly however Central automatically disconnects the link in 1-2 seconds with Display on LCD as "Reason: 22"

What is interpretation of Reason 22 and what should be done to solve and remove the error.

  • Reason 22 means the host terminates the link itself, which will happen if you accidentally click select button twice. What you can do is moving the following part of the code to some other button function(ex :  if(keys & KEY_DOWN ) to prevent doubling clicking select button. 

        else if (state == BLE_STATE_CONNECTING ||
                  state == BLE_STATE_CONNECTED)
        {
          // disconnect
          state = BLE_STATE_DISCONNECTING;
    
          GAPCentralRole_TerminateLink(connHandle);
          
          LCD_WRITE_STRING("Disconnecting", LCD_PAGE2);
          LCD_WRITE_STRING("", LCD_PAGE4);
        }

    Let me know if you still see disconnection after moving that part of the code to other buttons

  • Thanks for prompt reply. I have removed this part of code to other button, still I see same error.

    Also, I want to connect my central to 6 peripherals at a same time. I am using SimpleBLECentral application code. I see in SimpleBLECentral code that it has just one application state that is defined by below enum. Ideally, In order to support 6 peripherals, it should have application six states with each state specifically dedicated to one peripheral.

    What all changes , I need to make to connect 6 peripherals at a same time.

    enum {

    BLE_STATE_IDLE,

    BLE_STATE_CONNECTING,

    BLE_STATE_CONNECTED,

    BLE_STATE_DISCONNECTING

    };

  • Just for information, I am using CCS compiler
  • Hi,

    The number of peripherals that can be connected to the central has nothing to do with the BLE state. A central device coordinates separate connection events for each peripheral. It will enter connection event with device A, and then until the next connection event with device A, the central will connect with device B and exchange data ...etc

    Note that our default simpleBLECentral can only support up to 3 peripherals. If you need to connect to more, you can try MAX_NUM_BLE_CONNS = 4 and increasing the heap size.

    You can also consider using our multirole project to connect more than 3 devices.
    Multirole project can be found here : github.com/.../multi_role