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.

CC2640R2F: Change BLE CompID from LL_VERSION_IND on simple_central

Part Number: CC2640R2F


Can you change the BLE CompID from LL_VERSION_IND on simple_central in Simplelink SDK BLE?

There is some mention of the parameter here: https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/541842?LL-VERSION-IND but we could not find it in later  Simplelink SDK BLE projects.

Backtracking, the closest parameter we found was TI_COMPANY_ID, but in SimpleLink SDK BLE Plugin projects like temperature_sensor_broadcast  :

/* Company Identifier: Texas Instruments Inc. (13) */
#define TI_COMPANY_ID                        0x000D
 #define TI_ST_DEVICE_ID                      0x03
 #define TI_ST_KEY_DATA_ID                    0x00

/* Advertisement Data */
static uint8_t advertData[] = {
 0x02, /* Length of this data */
SAP_GAP_ADTYPE_FLAGS, DEFAULT_DISCOVERABLE_MODE
| SAP_GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

 /* Manufacturer specific advertising data */
0x06,
 0xFF, /* GAP_ADTYPE_MANUFACTURER_SPECIFIC, */
 LO_UINT16(TI_COMPANY_ID), HI_UINT16(TI_COMPANY_ID), TI_ST_DEVICE_ID,
 TI_ST_KEY_DATA_ID,
 0x00 };

But these do match the BT SIG definitions:

https://www.bluetooth.com/specifications/assigned-numbers/link-layer and https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers

Where do we define and how do we change LL_VERSION_IND ?

/* Company Identifier: Texas Instruments Inc. (13) */
#define TI_COMPANY_ID                        0x000D
#define TI_ST_DEVICE_ID                      0x03
#define TI_ST_KEY_DATA_ID                    0x00

  • Hi Joe,
    You cannot change the LL_VERSION_IND. If I understand the use case correctly, you should be able to simply add a unique manufacturer specific flag to the advertisement data.

    Or scan response could be used to provide additional information before connection is established.

    Best Regards
    Joakim
  • Hi Joakim,

    In this scenario we are operating as the central device and initiating the connection.  We would like to uniquely identify ourselves to the peripheral device at some point in the pairing process.

    Thanks,

    Tim

  • Gotcha. That's typically not the way BLE is setup to operate. Is there a requirement that the identification must be done prior to the connection being established? The reason I'm asking is because a GATT entry could be used to check authorization, and rapidly disconnect if necessary (Before or as the pairing just started. But that doesn't stop the Central from doing the same thing though. Also, I think that a hardcoded GATT interaction before a service discovery is not a recommended method anyway.

    Do they have access to an implementation on both the peripheral and central side? That would make it easier to implement a custom "handshake".
  • Closing for now since we got some good ideas offline to

    >>The reason I'm asking is because a GATT entry could be used to check authorization, and rapidly disconnect if necessary

    This idea secondary since seems too "deep" into the process (and setting up a GATT server on the Central takes some work).

    >>Or scan response could be used to provide additional information before connection is established.
    This primary idea looks more promising for implementation. And pursing with debug steps below for uniquely identifying the central to the peripheral (e.g. don't want the peripheral to accidentally connect to an iPhone).


    TI CC2640R2 can implement central + broadcaster profile. In TOOLS/build_config.opt, implement:
    /* -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG */
    (And can test with another TI CC2640R2 implementing peripheral + observer profile)

    So  (offline) steps to get pairing/bonding in Simple Central (and even Simple Peripheral) on Launchpads) we will pursue below:

    it is very simple to modify simple_central to do pairing/bonding – only a couple lines of code change. Here is how you can quickly get two Launchpads to do pairing & bonding as an example:
     
    For the central launchpad:
    1. Import simple_central example app + stack
    2. In the file simple_central.c, inside SimpleBLECentral_init, there is a section for setting up the GAP Bond Manager. In the 1.50 version of the simple_central example, this is starting at line 546:
      // Setup the GAP Bond Manager. For more information see the GAP Bond Manager
      // section in the User's Guide:
      {
        // Don't send a pairing request after connecting; the device waits for the
        // application to start pairing
        uint8_t pairMode = DEFAULT_PAIRING_MODE;
        // Do not use authenticated pairing
        uint8_t mitm = DEFAULT_MITM_MODE;
        // This is a display only device
        uint8_t ioCap = DEFAULT_IO_CAPABILITIES;
        // Create a bond during the pairing process
        uint8_t bonding = DEFAULT_BONDING_MODE;
     
        GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t),& pairMode);
        GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t),& mitm);
        GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t),& ioCap);
        GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t),& bonding);
      }
    1. In order for simple central to initiate pairing, you need to change the pairMode to use GAPBOND_PAIRING_MODE_INITIATE
    2. For mitm and ioCap, you should set these based on what kind of pairing you want to perform, per the tables found in the user’s guide http://dev.ti.com/tirex/content/simplelink_cc2640r2_sdk_1_50_00_58/docs/blestack/ble_user_guide/html/ble-stack-3.x/gapbondmngr.html#selection-of-pairing-mode these tables are defined by the Bluetooth SIG). For my example, I chose to set mitm to TRUE and ioCap to GAPBOND_IO_CAP_KEYBOARD_ONLY
    Here is my modified code section:
      // Setup the GAP Bond Manager. For more information see the GAP Bond Manager
      // section in the User's Guide:
      {
        // Don't send a pairing request after connecting; the device waits for the
        // application to start pairing
        uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
        // Do not use authenticated pairing
        uint8_t mitm = TRUE;
        // This is a display only device
        uint8_t ioCap = GAPBOND_IO_CAP_KEYBOARD_ONLY;
        // Create a bond during the pairing process
        uint8_t bonding = TRUE;
     
        GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t),& pairMode);
        GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t),& mitm);
        GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t),& ioCap);
        GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t),& bonding);
      }
     
     
    That is all I did. Now when I load the default SimplePeripheral example in my other Launchpad, and I run my modified SimpleCentral connected to a terminal window on my PC, I can see in my terminal window that pairing and bonding occurs when I do a connection. The simple peripheral example already has mitm as True and has GAPBOND_IO_CAP_DISPLAY_ONLY so the passcode method is used. But the examples are both set up to already use a default test code of 123456 for easy testing and automatically provides this from the central.