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-CC2640R2: About one certain peripheral's connection

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: BLE-STACK

Hi TI,

Now I have 2 functions to be achieve...

1.Run an APP on phone(Central, Master) to search CC2640R2s(Peripheral, Slave). When a CC2640R2 is found, it will operate its GPIO to lighten its LED. Or else, it will not lighten.

2.Hit a button on a lightened CC2640R2, and it(only this) will connect the phone. Other CC2640R2s(not lightened, not found or button not hit) will not connect.

Is there any method to achieve these on CC2640R2? I saw the MI bracelet had these functions. It lightens when it's found by bluetooth, and it connects by hitting it or rolling it(the accelerometer embeded in MI bracelet acts as the button).

Thanks.

  • Hi,

    1. You could implement this functionality when you get a Scan Request from the Central Device. Please see the API Guide for example of implementation: software-dl.ti.com/.../group___h_c_i.html
    After enabling Scan Request Reports, you would add your LED toggling code when the HCI_BLE_SCAN_REQ_REPORT_EVENT occurs. Note this feature was introduced in BLE-Stack 3.0.1
    2. If you are running the CC2640R2 as a peripheral only, you cannot initiate a connection. You can see this in Vol 3, Part C, Section 9.3 of the Bluetooth 4.2 Core Spec. You may be able to use a multirole configuration to connect to the phone, store the device address in the phone app then disconnect and have the phone automatically connect to the device address that was stored.
  • Thanks all the same, but it still doesn't work in my project.

    Besides, there are 2 key points perplexing me:

    1.
    This command requires the following define in the stack .opt file:
    -DEXTRA_ADV_FEAT=SCAN_REQ_RPT_CFG

    Where to define this? How can I write this into the proper position?


    2.
    Usage
    Configure the Bluetooth low energy protocol stack to return the event
    HCI_EXT_ScanReqRptCmd(HCI_EXT_ENABLE_SCAN_REQUEST_REPORT);

    Can I use this in the SimpleBLEPeripheral_Init() function? I've tried this, and no errors and no warnings reported, but it doesn't work.

    Thanks.