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.

LAUNCHXL-CC26X2R1: Secure Connection Pairing with GapBondMgr

Part Number: LAUNCHXL-CC26X2R1

Hello,

I am using a LAUNCHXL-CC26X2R1 flashed with Host_test app, sdk : simplelink_cc13x2_26x2_sdk_4_30_00_54

Our my scope is to create a pairing with oob data in secure connection mode. With the command GapBondMgr_SetParam I've set all the parameters including secure connection = GAPBOND_SECURE_CONNECTION_ONLY/ GAPBOND_SECURE_CONNECTION_ALLOW (tried both cases). 

I am using Ellisys sniffer to check the BLE messages between TI board - slave device and at SMP Pairing feature exchange the secure connection is not enabled (check the picture below)

Can you help me how should I fix this problem? I attached the BTool log too. 

[731] : <Tx> - 10:54:20.648
-Type           : 0x01 (Command)
-OpCode         : 0xFE62 (GapInit_connect)
-Data Length    : 0x0A (10) byte(s)
 PeerAddrType   : 0x01 (1) (PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID)
 PeerAddr       : 7A:E2:3A:84:17:F7
 InitiatingPhy  : 0x01 (1) (
                  INIT_PHY_1M)
 Timeout        : 0x0000 (0)
Dump(Tx):
0000:01 62 FE 0A 01 F7 17 84 3A E2 7A 01 00 00       .b......:.z...
--------------------------------------------------------------------
[732] : <Rx> - 10:54:20.673
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE62 (GapInit_connect)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 62 FE 00                      ......b..
--------------------------------------------------------------------
[733] : <Rx> - 10:54:20.716
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x14 (20) bytes(s)
 Event          : 0x0605 (1541) (GAP_EstablishLink)
 Status         : 0x00 (0) (SUCCESS)
 DevAddrType    : 0x01 (1) (ADDRTYPE_RANDOM)
 DevAddr        : 7A:E2:3A:84:17:F7
 ConnHandle     : 0x0000 (0)
 ConnRole       : 0x08 (8) (
                  Central)
 ConnInterval   : 0x0050 (80)
 ConnLatency    : 0x0014 (20)
 ConnTimeout    : 0x0C80 (3200)
 ClockAccuracy  : 0x00 (0)
Dump(Rx):
0000:04 FF 14 05 06 00 01 F7 17 84 3A E2 7A 00 00 08 ..........:.z...
0010:50 00 14 00 80 0C 00                            P......
--------------------------------------------------------------------
[734] : <Tx> - 10:54:20.718
-Type           : 0x01 (Command)
-OpCode         : 0x2022 (HCI_LE_SetDataLength)
-Data Length    : 0x06 (6) byte(s)
 Handle         : 0x0000 (0)
 TxOctets       : 0x00FB (251)
 TxTime         : 0x0848 (2120)
Dump(Tx):
0000:01 22 20 06 00 00 FB 00 48 08                   ." .....H.
--------------------------------------------------------------------
[735] : <Info> - 10:54:20.824
Device Connected
Handle = 0x0000
Addr Type = 0x01 (ADDRTYPE_RANDOM)
BDAddr = 7A:E2:3A:84:17:F7
--------------------------------------------------------------------
[736] : <Rx> - 10:54:20.760
-Type           : 0x04 (Event)
-EventCode      : 0x000E (HCI_CommandCompleteEvent)
-Data Length    : 0x06 (6) bytes(s)
 Packets        : 0x01 (1)
 OpCode         : 0x2022 (HCI_LE_SetDataLength)
 Status         : 0x00 (0) (SUCCESS)
 Handle         : 0x0000 (0)
Dump(Rx):
0000:04 0E 06 01 22 20 00 00 00                      ...." ...
--------------------------------------------------------------------
[737] : <Rx> - 10:54:21.004
-Type           : 0x04 (Event)
-EventCode      : 0x003E (HCI_LE_GenericReportEvent)
-Data Length    : 0x0C (12) bytes(s)
 LE Event Code  : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent)
 LE Event Code  : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent)
 Status         : 0x00 (0) (SUCCESS)
 ConnectionId   : 0x0000 (0)
 Features       : 0x00000000000059FF (23039) (
                  Encryption
                  Connection_Parameters_Request
                  Reject_Extended_Indication
                  Slave_Features_Exchange
                  Ping
                  Data_Packet_Length_Extension
                  Privacy
                  Extended_Scanner_Filter_Policies
                  PHY_2M
                  Coded_PHY
                  Extended_Advertising
                  Channel_Selection_Algorithm_2)
Dump(Rx):
0000:04 3E 0C 04 00 00 00 FF 59 00 00 00 00 00 00    .>......Y......
--------------------------------------------------------------------
[738] : <Tx> - 10:54:44.888
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0411 (1041) (GAPBOND_SECURE_CONNECTION)
 ParamLength    : 0x01 (1)
 BondSecureCxns : 0x02 (2) (GAPBOND_SECURE_CONNECTION_ONLY)
Dump(Tx):
0000:01 36 FE 04 11 04 01 02                         .6......
--------------------------------------------------------------------
[739] : <Rx> - 10:54:44.922
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[740] : <Tx> - 10:54:57.447
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0400 (1024) (GAPBOND_PAIRING_MODE)
 ParamLength    : 0x01 (1)
 PairingMode    : 0x02 (2) (GAPBOND_PAIRING_MODE_INITIATE)
Dump(Tx):
0000:01 36 FE 04 00 04 01 02                         .6......
--------------------------------------------------------------------
[741] : <Rx> - 10:54:57.482
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[742] : <Tx> - 10:55:06.963
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0402 (1026) (GAPBOND_MITM_PROTECTION)
 ParamLength    : 0x01 (1)
 MitmEnable     : 0x01 (1) (True)
Dump(Tx):
0000:01 36 FE 04 02 04 01 01                         .6......
--------------------------------------------------------------------
[743] : <Rx> - 10:55:07.000
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[744] : <Tx> - 10:55:10.632
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0403 (1027) (GAPBOND_IO_CAPABILITIES)
 ParamLength    : 0x01 (1)
 BondIOCaps     : 0x03 (3) (GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT)
Dump(Tx):
0000:01 36 FE 04 03 04 01 03                         .6......
--------------------------------------------------------------------
[745] : <Rx> - 10:55:10.683
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[746] : <Tx> - 10:55:15.376
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0404 (1028) (GAPBOND_OOB_ENABLED)
 ParamLength    : 0x01 (1)
 OobEnabled     : 0x01 (1) (True)
Dump(Tx):
0000:01 36 FE 04 04 04 01 01                         .6......
--------------------------------------------------------------------
[747] : <Rx> - 10:55:15.407
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[748] : <Tx> - 10:55:20.745
-Type           : 0x01 (Command)
-OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
-Data Length    : 0x04 (4) byte(s)
 ParamID        : 0x0406 (1030) (GAPBOND_BONDING_ENABLED)
 ParamLength    : 0x01 (1)
 BondingEnabled : 0x01 (1) (True)
Dump(Tx):
0000:01 36 FE 04 06 04 01 01                         .6......
--------------------------------------------------------------------
[749] : <Rx> - 10:55:20.773
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE36 (GAPBondMgr_SetParameter)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 36 FE 00                      ......6..
--------------------------------------------------------------------
[750] : <Tx> - 10:55:41.905
-Type           : 0x09 (ExtCommand)
-OpCode         : 0xFE48 (GAPBondMgr_Pair)
-Data Length    : 0x0200 (512) byte(s)
 ConnHandle     : 0x0000 (0)
Dump(Tx):
0000:09 48 FE 02 00 00 00                            .H.....
--------------------------------------------------------------------
[751] : <Rx> - 10:55:41.944
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (SUCCESS)
 OpCode         : 0xFE48 (GAPBondMgr_Pair)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 48 FE 00                      ......H..
--------------------------------------------------------------------
[752] : <Rx> - 10:55:44.907
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x6B (107) bytes(s)
 Event          : 0x060A (1546) (GAP_AuthenticationComplete)
 Status         : 0x05 (5) (SMP_PAIRING_FAILED_NOT_SUPPORTED)
 ConnHandle     : 0x0000 (0)
 AuthState      : 0x00 (0) (
                  AuthReq Bit Mask Is Not Set)
 SecInf.Enable  : 0x00 (0)
 SecInf.LTKSize : 0x00 (0)
 SecInf.LTK     : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SecInf.DIV     : 0x0000 (0)
 SecInf.Rand    : 00:00:00:00:00:00:00:00
 DSInf.Enable   : 0x00 (0) (Disable)
 DSInf.LTKSize  : 0x00 (0)
 DSInf.LTK      : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 DSInf.DIV      : 0x0000 (0)
 DSInf.Rand     : 00:00:00:00:00:00:00:00
 IdInfo.Enable  : 0x00 (0)
 IdInfo.IRK     : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 IdInfo.BD_Addr : 00:00:00:00:00:00
 IdInfo.AddrType: 0x00 (0) (ADDRTYPE_PUBLIC)
 SignInfo.Enable: 0x00 (0) (Disable)
 SignInfo.CSRK  : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SignCounter    : 0x00000000 (0)
Dump(Rx):
0000:04 FF 6B 0A 06 05 00 00 00 00 00 00 00 00 00 00 ..k.............
0010:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060:00 00 00 00 00 00 00 00 00 00 00 00 00 00       ..............
--------------------------------------------------------------------

Secure connection pairing.zip

  • Found out this behavior is reproducible only when GAPBondManager Test Mode! is defined.

    We would expect that test mode should not interfere with Secure Connections.

  • Hi,

    I've assigned an expert to assist you with this.

    Best Regards,
    Alec

  • Hey Kris,

    Thanks for the logs and the sniffer capture. You mention this behavior only occurs with GAPBONDMGR_TESTMODE defined, correct? I don't see why this is being enabled, but the following could be the cause for this behavior. This is the code inside GAPBondMgr_ProcessEvent(). 

    // Pass all events to app in test mode
    #ifdef GAPBONDMGR_TESTMODE
          gapBondMgr_ProcessOSALMsg((osal_event_hdr_t *)pMsg);
          // In TESTMODE pass through all GAP_MSG_EVENTs to Application
          osal_event_hdr_t *pTmpMsg = (osal_event_hdr_t *)pMsg;
          if(pTmpMsg->event == GAP_MSG_EVENT)
    #else // GAPBONDMGR_TESTMODE
          if(!gapBondMgr_ProcessOSALMsg((osal_event_hdr_t *)pMsg))
    #endif // GAPBONDMGR_TESTMODE

    Perhaps the event is received but not processed by the application (which would be Btool in this case, not a typical simple peripheral/central example). As BTool doesn't behave the same as a typical embedded example, I would advise against using this if Secure Connections is enabled.