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.

Callback for scan request?

Other Parts Discussed in Thread: CC2540

I'm working on a simple tag project using the CC2540 keyfob in broadcaster mode. I've figure out how to dynamically change the advertising data whenever I press the left button on the fob, however I'd like to be able to call my update function without touching the device. 

For that, I'd like to be able to call the update whenever a scan request is received. But I can't seem to figure out what event/callback is thrown when a scan happens and the scan response data is sent. Can anyone help me out?

Cheers

  • *bump* This is also something I am interested in being able to do. Unfortunately I can't find any other forum posts talking about it or any event types in the TI stack which might make it possible. Does anyone know whether this is even possible to do? It seems reasonable to want to know when an active scan request is received by your device before the scan response is sent.

  • I am also looking for this information.

  • I am also looking for setting a callback that will run when a scan-request is received.

    I don't need an immediate execution. It's ok if the callback will be called only after the scan-response was sent.

    I found functions like HCI_EXT_AdvEventNoticeCmd and LL_EXT_AdvEventNotice, but I don't know how to use them or if they will help (does the event contains information about whether a scan-request was received after the advertisement?).

    Thanks

    --- EDIT ---

    OK, I'm using HCI_EXT_AdvEventNoticeCmd(simpleBLEPeripheral_TaskID, MY_EVENT) so SimpleBLEPeripheral_ProcessEvent is called with MY_EVENT every advertisement, which is very useful if you want to count advertisements (without evaluating on time estimations).

    I still cannot tell whether the advertisement was answered with a scan-request (and answered back with a scan-reply).

    Is it even possible?