CC2340R5: BLEAPPUTIL_SCAN_REQ_RECEIVED never being fired

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Identical to this thread, I'm unable to receive BLEAPPUTIL_SCAN_REQ_RECEIVED events:

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1445199/cc2340r5-scan-request-from-central-device-issue

I'm using SDK version 8.40.0.61 basic_ble_profiles project with the only modification being adding BLEAPPUTIL_SCAN_REQ_RECEIVED to peripheralAdvHandler and a case handler to Peripheral_AdvEventHandler().

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
BLEAppUtil_EventHandler_t peripheralAdvHandler =
{
.handlerType = BLEAPPUTIL_GAP_ADV_TYPE,
.pEventHandler = Peripheral_AdvEventHandler,
.eventMask = BLEAPPUTIL_ADV_START_AFTER_ENABLE |
BLEAPPUTIL_ADV_END_AFTER_DISABLE |
BLEAPPUTIL_SCAN_REQ_RECEIVED
};
case BLEAPPUTIL_SCAN_REQ_RECEIVED:
{
scanReq++;
break;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I'm using Ti's Simplink iOS scanning application and I know the scan request is happening because I can see the correct local name - 'Basic BLE project'. As stated above, I'm using the basic BLE profiles project out of the box with the only modifications being in the code snippet above, but here's my sysconfig Broadcaster Configuration just in case there's any questions:

Thank you for any help provided.

  • Hi,

    Thank you for reaching out. We will look into your question and get back to you as soon as possible. In the meantime, can you confirm the IDE version along with the simplelink connect version?

    Best Regards,

    Jan

  • Hi Jan,

    Sure, no problem.

    Code Composer Studio version 20.0.1.4

    SimpleLink Connect version 1.3.8. I've tried with nRF Connect (2.7.15) and my own proprietary iOS application, but the BLEAPPUTIL_SCAN_REQ_RECEIVED is never fired.

    -Rob

  • I just realized that there's an updated version of Code Composer Studio (20.0.2.5) so I upgraded and tried again - still the same issue.

  • Hello Rob,

    Could you please search for GAP_ADV_EVT_MASK, which should be inside gap_advertiser.h file and share the events that are enabled? I would expect one being like this: GAP_ADV_EVT_MASK_SCAN_REQ_NOTI.

    BR,

    David.

  • Hi David,

    My BLEAppUtil_initAdvSet() in bleapputil_init.c is setting the event mask to GAP_ADV_EVT_MASK_ALL. In my gap_advertiser.h file, GAP_ADV_EVT_MASK_ALL is set to:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    typedef enum
    {
    /**
    * Enables / disables the @ref GAP_EVT_SCAN_REQ_RECEIVED event
    */
    GAP_ADV_EVT_MASK_SCAN_REQ_NOTI = AE_NOTIFY_ENABLE_SCAN_REQUEST,
    /**
    * Enables / disables the @ref GAP_EVT_ADV_SET_TERMINATED event
    */
    GAP_ADV_EVT_MASK_SET_TERMINATED = BV(1),
    /**
    * Enables / disables the @ref GAP_EVT_ADV_START_AFTER_ENABLE event
    */
    GAP_ADV_EVT_MASK_START_AFTER_ENABLE = AE_NOTIFY_ENABLE_ADV_SET_START,
    /**
    * Enables / disables the @ref GAP_EVT_ADV_START event
    */
    GAP_ADV_EVT_MASK_START = AE_NOTIFY_ENABLE_ADV_START,
    /**
    * Enables / disables the @ref GAP_EVT_ADV_END event
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thank you,

    Rob

  • Can Ti not reproduce this issue on their end? I'm running an example project with very minimal modifications using all Ti products. Should be easy to reproduce then dig into the actual BLE proprietary code, which I can't see, and figure out what's going on here.

  • Hello Rob,

    I have been able to reproduce it now and currently working on it. Please bear with me. I will update you as soon as possible.

    BR,

    David.

  • Hello Rob,

    I am working with the expert team to find the solution. May I ask what are you trying to implement at an application level so we can see if there is another way to accomplish the same behaviour in the meantime?

    BR,

    David.

  • Hi David,

    Ok, thank you for the help!

    Here's my strategy for using BLEAPPUTIL_SCAN_REQ_RECEIVED to consume as little power as possible, but still connect if my mobile app is in range:

    1. Initially use a beacon (advertising at 1.022 seconds) to alert my mobile app of BLE presence.
    2. On the scan request received notification switch to normal BLE service advertisements at 100mS and wait for a connection event from the mobile app
    3. Once connected do what I need to do then disconnect and return to step 1 an hour later

    Will this work assuming the scan request event gets fixed?

    Thank you,

    Rob

  • Hello Rob,

    For some extra things you can do for power consumption optimization, I would suggest to take a look here:  Optimizing Bluetooth Low Energy Power Consumption. I assume this mechanism you describe will be used for any BLE device (not only an specific one that the peripheral is expecting), because under this process the device will change adv interval whenever it receives a scan req from any device. I think this will work as you intend considering the fix. I would suggest a couple more things depending your application:

    1. Once the device gets the connection request, evaluate proximity with RSSI to then choose to reduce adv interval. I sugges to take a look at this thread for it: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1288568/launchxl-cc26x2r1-launchxl-cc26x2r1/4889751#4889751
    2. Once the device decides to reduce the adv interval, how long will it be advertising under those conditions? I would suggest tot take a look at Limited Advertising here: https://software-dl.ti.com/simplelink/esd/simplelink_lowpower_f3_sdk/8.40.00.61/exports/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/gap-cc23xx.html?#limited-advertising

    I will update you as soon as possible regarding the issue.

    BR,

    David.