CC2651R3: Why is GAPBondMgr_Pair() needed to trigger pairing in board-to-board setup (MultiRole example, SDK 7.10.02.23)?

Part Number: CC2651R3

Tool/software:

Hello,

I am working with the MultiRole example from the following SDK and platform:

SDK: C:\ti\simplelink_cc13xx_cc26xx_sdk_7_10_02_23
Board: LP_CC2651R3SIPA
Example: ble5stack\multi_role

My use case:

I have a custom characteristic with GATT_PERMIT_ENCRYPT_READ.

In smartphone Left right arrow board connection, when the phone tries to read this characteristic, the pairing sequence starts automatically (pairing popup appears, using Just Works).

In board Left right arrow board connection (MultiRole Left right arrow MultiRole), when I call GATT_ReadCharValue(), the call succeeds but returns bleInsufficientEncrypt (0x42). Pairing does not start automatically.

To work around this, I explicitly call:GAPBondMgr_Pair(pMsg->connHandle);
inside the ATT error response handling, which then triggers the multi_role_processPairState() flow and pairing and bonding completes successfully.

My question:
Point right Why is it necessary to manually call GAPBondMgr_Pair() in the board-to-board scenario to trigger pairing, while in the smartphone scenario the stack automatically initiates pairing when accessing an encrypted characteristic?

Is this expected behavior of the MultiRole example, or is there some configuration in the Bond Manager / GAP role that I may have missed?

My bond manger setting in syscfg

uint8_t pairMode                =    GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8_t mitm                    =    false;
uint8_t ioCap                   =    GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
uint8_t bonding                 =    true;
uint8_t secureConnection        =    GAPBOND_SECURE_CONNECTION_ONLY;
uint8_t authenPairingOnly       =    false;
uint8_t autoSyncWL              =    true;
uint8_t eccReGenPolicy          =    0;
uint8_t KeySize                 =    16;
uint8_t removeLRUBond           =    true;
uint8_t bondFailAction          =    GAPBOND_FAIL_TERMINATE_ERASE_SINGLE_BOND;
uint8_t KeyDistList             =    GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SIDKEY | GAPBOND_KEYDIST_SSIGN;
uint8_t allowDebugKeys          =    false;
uint8_t eraseBondWhileInConn    =    false;
uint8_t sameIrkAction           =    GAPBOND_SAME_IRK_UPDATE_BOND_REC;

Thanks,
Vikas

  • Hello Vikas,

    Thanks for reaching out! Is this behavior also seen when using a normal GATT_PERMIT_READ rather than a GATT_PERMIT_ENCRYPT_READ? I suspect the issue is with the reading and not the actual pairing process.

    Best Regards,

    Tarek D

  • Hello Tarek,

    Thanks for your response!

    I tried replacing GATT_PERMIT_ENCRYPT_READ with GATT_PERMIT_READ. In this case, when the central issues a read, the flow in multi_role_processGATTMsg() goes into the else case (not the expected read/error response path). I added a call to GAPBondMgr_Pair(pMsg->connHandle) , I am able to successfully pair and bond.

    So the behavior I’m seeing is that the stack does not automatically initiate pairing when accessing the characteristic, unless I explicitly call GAPBondMgr_Pair().

    Does this mean that in the board-to-board setup (MultiRole example, SDK 7.10.02.23), we are expected to manually trigger pairing using GAPBondMgr_Pair() in response to ATT_ERROR_RSP , instead of relying on automatic pairing?

    Best Regards,
    Vikas

  • Hello Vikas,

    If you would like to initiate a pairing request when the other device interacts with a specific characteristic and not automatically upon establishing a connection, then yes, you will need to call GAPBondMgr_Pair() inside your code. If you would like to automatically pair, you will need to change the syscfg pairing mode from "wait for a pairing request" to " Initiate a pairing request".

    I hope this helps!

    Best Regards,

    Tarek D