Tool/software:
Identical to this thread, I'm unable to receive BLEAPPUTIL_SCAN_REQ_RECEIVED events:
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().
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; }
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
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:
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 */ GAP_ADV_EVT_MASK_END = AE_NOTIFY_ENABLE_ADV_END, /** * Enables / disables the @ref GAP_EVT_ADV_END_AFTER_DISABLE event */ GAP_ADV_EVT_MASK_END_AFTER_DISABLE = AE_NOTIFY_ENABLE_ADV_SET_END, /** * Mask to enables / disable all advertising events */ GAP_ADV_EVT_MASK_ALL = GAP_ADV_EVT_MASK_SCAN_REQ_NOTI | GAP_ADV_EVT_MASK_START_AFTER_ENABLE | GAP_ADV_EVT_MASK_START | GAP_ADV_EVT_MASK_END | GAP_ADV_EVT_MASK_END_AFTER_DISABLE | GAP_ADV_EVT_MASK_SET_TERMINATED, /// @cond NODOC /** * Used to set this to 16 bits for future events */ GAP_ADV_EVT_MASK_RESERVED = BV(15) /// @endcond // NODOC } GapAdv_eventMaskFlags_t;
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:
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:
I will update you as soon as possible regarding the issue.
BR,
David.