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-Q1: Advertisement status monitoring in BLE stack

Part Number: CC2640R2F-Q1

Hi engineers,

How do we monitor the advertising status in BLE stack (NOT BLE 5) given we don't have the callback function. I found GAP_END_DISCOVERABLE_DONE_EVENT but I'm not sure is it reliable. Can you help me on confirming if it can report abnormal behavior of advertising procedure?

If you have any method to monitor advertising status (connection status also welcome), please guide me as well.

  • Hello,

    Thank you for posting on the E2E forums! What SDK are you currently using?

    Best,

    Nima

  • Hi Nima,

    SDK version is simplelink_cc2640r2_sdk_5_30_00_03

  • Hi Simon,

    GAP_END_DISCOVERABLE_DONE_EVENT will be sent once advertising has ended, but not during advertising. Using a Bluetooth sniffer to monitor the packets can confirm if anything abnormal is happening with the packets. However, with some more information I think I can provide better information.

    What is the use case of the application, and why would you like to monitor advertising?

    Best,

    Nima

  • Hi Nima,

    Sorry for not so clear. Customer is trying to use this monitoring result in their application. Once the advertising abnormal behavior happens, they want to automatically reset the device. It is not only for debug, but an application feature use case.

  • Hi Simon,

    Will the device have any active connections, and if so how many? By resetting the device whenever advertising acts abnormal will reset all connections, which may fix the issue temporarily but once these connections are established again advertising may start acting abnormal again.

    Is the customer experiencing abnormal advertising?

    Best,

    Nima

  • Hi Nima,

    It is related to customer's application logic, I think they cannot share more information on that. I'll deliver your concern on that anyway.

    So my question here is

    1. if GAP_END_DISCOVERABLE_DONE_EVENT is sent normally, is it a solid proof that advertising is working fine? If not ,what will be.

    2. for BLE stack, is there a function LIKE below(from BLE5) to report advertisement once a RF code advertising event happens

  • Hi Simon,

    1. GAP_END_DISCOVERABLE_DONE_EVENT will occur once GAP_EndDiscoverable() is called, so not during advertising but once advertising has ended. There is no event that is called to notify that advertising is still enabled. However, you can verify that advertising started correctly by calling GAP_MakeDiscoverable() which will post the event GAP_MAKE_DISCOVERABLE_DONE_EVENT or checking the return status of the function.

    2. I don't believe so because you would need callbacks to receive those events. I will consult my team and get back to you on this.

    In the meantime, a solution to this may be to use timers. After starting advertising, set a timer to call GAP_MakeDiscoverable() periodically to check its the return status. If the status is bleAlreadyInRequestedMode, then advertising is still running. If it returns anything else, then advertising is either behaving abnormally or not running at all. Once advertising has finished, then stop the timer.

    Best,

    Nima