This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Broadcast Scan Request Acknowledgement

My application:

I have a peripheral (S110) that registers important alerts and immediately broadcasts them to any central that is listening. There will be some amount (ideally 10-12 bytes) of manufacturer specific data in the advertisement packets. It is very important that at least one device recognizes the alert being broadcast, and as such I am trying to build my application to broadcast until it knows that the alert has been "heard". I had initially hoped to use the peripheral as a simple broadcaster that accepted a scan response as a form of acknowledgement (I didn't need the second packet to transfer more data, but I wanted to use the response from the central as the acknowledgement.) However, I’ve found that there is no straightforward way to create an application event when the SoftDevice receives and responds to a scan request.

Additional application constraints This is a battery powered device and needs to conserve as much power as possible, so I want to stop broadcasting as soon as a central get the alert, or after some timeout. I hope to not ever timeout as the alerts are important, but I also don’t want the device broadcasting until it dies if nothing is around to receive the alert.

Another constraint is that the peripheral device is going to have a more powerful antenna and longer range than the centrals (smart phones). This means that there will be times when something picks up the alert, but doesn’t have the range to transmit the response. This also means that a dedicated connection is impractical (and I want multiple phones to be capable of receiving the alert).

I did a ton of research through devzone and found a few people trying to do similar things. Here are two workarounds that I found, and a possible 3rd option that I’ve come up with:

Use the timeslot API and circumvent the SoftDevice DevZone post: devzone.nordicsemi.com/.../

I haven’t tried this yet but I’m hesitant to use non-supported code for my application because this is one of the most important features, and I don’t feel comfortable debugging this example code if problems arise. Additionally, this does slightly more than I need in that it gives information about the central that responds to the scan request, which I don’t need (just an acknowledgement that something has heard.

Use radio notifications DevZone post: devzone.nordicsemi.com/.../

The basic idea behind this is to use radio notifications and the timer to measure the amount of time the radio spends in transmit versus receive modes, and infer that a change in the time (I’m not clear on what this difference would be exactly) to detect when a scan response has been issued. The post says that this method would be “pretty reliable”, but it sounds pretty hacky to me.

My possible solution/question Would it be possible to advertise as a connectable device and then simply sever the connection when the central responds as a means of alert acknowledgement (or timeout after a specified time)? This would still need to send the manufacturer specific data in the advertising packets. Is this a feasible solution? How would this method affect the power consumption of the device? Any comments on this approach, or an alternate strategy would be greatly appreciated.

Finally I would love it if Nordic added this to the SoftDevice’s capabilities!

Thanks, Seth

Related