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.

RTOS/LAUNCHXL-CC2640R2: Multiple pairing issue and pairing timeout question

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC2640

Tool/software: TI-RTOS

Hi,

I am using project_zero / multi_role hybrid from 1.50.0.58 sdk. 

passkey = 123456;

pairMode =GAPBOND_PAIRING_MODE_INITIATE;

mitm = TRUE;

iocap = GAPBOND_IO_CAP_DISPLAY_ONLY

bonding = FALSE;

I am able to connect two android(7.0, Huawei and 7.1.2, Xiaomi) centrals to one cc2640 peripheral and pair them both, but those actions have to be done separately, one after another.

1) QUESTION

Is it possible to pair two devices at the same time (within a few seconds)? When I try to do it I get like this:

ANDROID1 ANDROID2
connection established connection established
pairing request from slave pairing request from slave
press ok press ok
code request, Loginfo says "needed 123456" popup in the LightBlue app says "pairing failed", Loginfo says "pairing failed: code 0x08", sometimes also "FC Violated: 16"
type in 123456
waiting for Loginfo to say "paired" but get "Disconnected!" instead

Is it a Bluetooth specification thing or TI implementation of BLE that it is impossible to pair more devices simultaneously? Or maybe it is possible but I can't do it.

2) QUESTION

When cc2640 sends pairing request and I accept popup notification on Android side, then click pair BUT NOT TYPE CODE IN I get disconnected after like 30~ seconds and Loginfo says "pairing failed, code 23".

Is there any place in code I can change the timeout value? Or is it a matter of Android version or vendor specific implementation and I can do nothing about it?

Thanks,
Paul

  • Hi Paul,

    1) Yes it should be possible to pair with two devices simultaneously if you have GBM_QUEUE_PAIRINGS defined in the stack project. In this case the GAPBondMgr will queue up pairing requests as they come in if one is already in process. This define isn't on by default though, so you may need to add it to your stack build

    2) The timeout is defined by the BLE Spec in Version 4.2 Vol 3, Part H, Section 3.4. The SMP timeout is set to 30s.
  • Hi Sean,

    Thanks for quick reply! :)

    I have added GBM_QUEUE_PAIRINGS to Predefined Symbols in project properties, so functions like gapBondMgrQueuePairing(...) in gapbondmgr.c became available. But I am still getting the same errors when trying to pair two devices at the same time.
    What am I missing?

    Thanks,
    Paul
  • Hi Paul,

    It definitely sounds like something is wrong.
    Can you run the following tests to give us more information

    - What SDK version are you using?
    - Do you have a sniffer capture available?
    - If you enable HEAPMGR_METRICS in your project and re-run the test, do you see any heap failures?
    - Confirm you rebuild and reloaded stack and app after adding the GBM_QUEUE_PAIRINGS flag.

    Internally the security manager implementation can only handle one pairing request at a time, but using the GBM_QUEUE_PAIRINGS flag, it should be possible to have the bond mgr queue them up and process them in order.

    Additionally, unrelated to pairing, it appears that you are occasionally getting flow control violated events. This means that the ATT request/response or indication/confirmation flow control has been violated. Some devices may drop the connection when this occurs. A sniffer capture will help decipher this.