Detecting scan response request at peripheral

I'm developing with an nRF52832, NCS V2.6.0 (happy to update to a newer SDK if it gets me the functionality I need) and Zephyr 3.5

What I'm currently doing is having my peripheral exist System Off via a GPIO trigger (generated by an external RTC at set intervals), briefly advertise with an advertising and scan response packet, then go back into System Off. It advertises long enough for our custom app to detect and grab the scan response packet, but nothing else.

What I want to be able to do is trigger the peripheral to stay "awake" for longer if it detects a scan response request from the central, so that the central can then make a connection and allow a user to download a log file, or do a DFU. And preferably only if it's out custom app that's making the scan response request, and not any other centrals.

Does anyone know:

1. If this is possible?

2. How I'd configure my peripheral to achieve it?

3. How I'd configure my central (custom app) so that the peripheral only extended its advertising time if it's our custom app (or some other "approved" central) that's making the scan response request?

Thanks,

Mike

Parents
  • Hi,

    Normally it's less power consumption to use normal system ON idle to periodically run the application with e.g. advertisement than using an approach with system OFF if you do any activity more often than a few minutes. The reason for this is that the time to re-init the device comes with a cost compared to just draw 3-4uA continuously. 

    But to answer your question; The peripheral advertising should be able to detect both a SCAN request response and CONNECT request packet while advertising, the application can use this to decide whether it should go to system OFF or not.

    Kenneth

Reply
  • Hi,

    Normally it's less power consumption to use normal system ON idle to periodically run the application with e.g. advertisement than using an approach with system OFF if you do any activity more often than a few minutes. The reason for this is that the time to re-init the device comes with a cost compared to just draw 3-4uA continuously. 

    But to answer your question; The peripheral advertising should be able to detect both a SCAN request response and CONNECT request packet while advertising, the application can use this to decide whether it should go to system OFF or not.

    Kenneth

Children
  • Hi Kenneth,

    I am looking into the energy budget of reverting to System On with idle compared to going into System Off, as I can see there is about a 500msec start delay exiting System Off. The System Off is a bit of a legacy design feature on this project.

    In terms of getting the peripheral to detect and report a scan request in my firmware, is there a CONFIG setting I need to enable? And then some callback that I need to add to process the detection of a scan request?

    I had a search on the DevZone but could t find anything that would answer those questions.

    Thanks,

    Mike

Related