Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

CC2652R7: Use GapInit_connect() function in Simple peripheral example

Part Number: CC2652R7
Other Parts Discussed in Thread: LAUNCHXL-CC26X2R1

Tool/software:

Dear Team,

I am working on a project which is built on Simple_peripheral example with SimpleLink CC13xx CC26xx SDK (7.41.00.17), and I changed the device's pairing mode to 'Initiate a pairing request'. 

Now after the first time my phone connects to the device and bonds to the device, I want my device can auto reconnect to my phone when I power on it in the subsequent time (like those wireless speakers and earphones). Can I use the GapInit_connect() to do this? If yes, I am struggling how to get the bonded device address to use this function, do you have any suggestions?

Thanks a lot.

  • Hi,

    Thank you for reaching out. When using Bluetooth LE, only the central device can initiate a connection. Typically, smart phones will act as the central device and the accessories (such as speakers or headphones) behave as a peripheral. To cause the connection to auto-form, the CC2652R7 should be left advertising and the smart phone should have some sort of application that scans and connects to the CC2652R7 automatically. You can also implement certain accessory profiles (such as HID) which will cause the smart phone to auto-connect without the use of a custom app, but these are restricted to certain use cases.

    I highly recommend referencing the connections lab for more information:

    https://dev.ti.com/tirex/content/cc13xx_cc26xx_simplelink_academy_7_41_00_00/_build_cc13xx_cc26xx_simplelink_academy_7_41_00_00/source/ble5stack/ble_connections/ble_connections.html

    Best Regards,

    Jan

  • Thank you for the information.

    For accessory profiles (such as HID) you have mentioned, may I know is there any Ti related document for more information?

    Thanks a lot!

  • Hi,

    No problem! This will vary by the OS, but you should be able to find information about which services have native support for Android and iOS in their developer forums or their developer documentation.

    Best Regards,

    Jan

  • Hi Jan,

    I found your example 'The HID Over GATT Profile (HOGP)' in GitHub(https://github.com/TexasInstruments/HOGP-BLE-HID-EXAMPLE) and tried to import to CCS. But then I found that I cannot build the project, I am using CCS12.8.1.

    May I know is there another way to import the project like directly import via 'Resource Explorer'? Or the example is not compatible for CCS12.8,1 and CC2652R7?

    Thanks a lot!

  • Hi,

    Glad you were able to find the example! I would highly recommend reading the companion app note I have written for that example (linked below):

    https://www.ti.com/lit/swra715

    Table 5.1 lists the software and hardware requirements for that specific example. The example was made for SDK 5.10 and CCS 10.3 usign the LAUNCHXL-CC26X2R1. That said, you should be able to migrate the example to the latest SDK and the CC2652R7 through the use of the migration guides included in the SDK. Once migrated, I expect the example to be able to work as expected on the R7 device as well.

    Best Regards,

    Jan

  • Hi Jan, 

    I tried to migrate the example of 'The HID Over GATT Profile (HOGP)' these days. It seems it did not do the auto-connect to the phone. Then I tried to learn the codes in 'hiddev.c', and I found

    ' if (HidDev_bondCount() > 0)
    {
    // Start high duty cycle advertising.
    status = GapAdv_enable(advHandleHigh, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0);
    HIDDEV_ASSERT(status == SUCCESS);
    hidAdvState = HID_ADV_STATE_HIGH;
    }'

    It seems if found that there is a bounded device, it will change 'hidAdvState', but this is still in advertising stage. So, I am confused that which part of codes may do the auto-connect function. Could you help me with this? Thank you so much!

  • Hi,

    If the phone is not auto-connecting, then its possible the CC device is either not advertising or the bond was not formed. Can you double check if the pairing was completed or if you can see the advertisements from another device?

    Best Regards,

    Jan