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

Using Scan Request as a means of acknowledging beacon sensors advertisement

Hello,

I have battery BLE sensor modules that send sensor data as BLE advertisements (custom advertisement, not beacon format).  A BLE observer receives the BLE sensor data and converts it to MQTT for processing.  Is it possible to have the observer send out a Scan Request as a way of acknowledging to the sensor that the advertisement was received?  But I don't want the observer to expect a Scan Response, nor do I want the sensor to send out a Scan Response.  I might resend the sensor advertisement if a Scan Request has not been received.

I'm not clear about the timing behind how scan requests are sent and received.  With GATT, the Central sends a connection request at a specific time delay after it receives a peripheral's advertisement.  The peripheral knows what this time delay is and can sleep/turn off radio until it's time to listen to the connection request.  I believe this is actually what happens in real life for peripheral devices to save power, and the softdevice handles all of this for us as long as we set the advertisement parameters correctly.  Is that right?

My specific questions:

1.  Does this built-in delay apply for peripherals to listen for scan requests after sending an advertisement?

a.  If so, does this delay happen after advertising on all 3 channels, or is the peripheral suppose to listen to the Scan Request after every channel's transmission (so it listens to just that channel)?

2.  Is there enough flexibility with advertisement modes to configure the peripheral to advertise and listen to scan request, but not respond to scan request?  Similar question for the central - send scan request without actually listening for scan response.

I'm trying to determine if it's feasible to add acks to sensor advertisements in a way that still preserves long battery life for the sensor.  Listening for scan requests for a long time immediately after an advertisement seems like a waste of battery.  And although similar acknowledge functionality can be achieve with real GATT connections via Indications, actual GATT connections would consume too much power. 

  • Hi Eric, 

     Q1: Yes, if the peripheral is advertising as a scannable device, then the peripheral will turn on its receiver after every advertisment packet. 

    Q2: It is possible to reconfigure the advertisement data so that the peripheral stops advertising as a scannable device and starts advertising as a non-scannable device.   As far as I know there is no way to send scan requests as a central without scanning for advertisement packets first

    And although similar acknowledge functionality can be achieve with real GATT connections via Indications, actual GATT connections would consume too much power. 

    This is not entirely correct as the current consumption in a connection versus broadcasting is highly application specific. As you already pointed out advertising will send the same data on 3 channels every advertisment interval and in a connection its only sent on one channel. Hence, an advertisement interval of 3 seconds will be the same as being in a connection with connection interval of 1 seconds in terms of current consumption. 
    In addition you may also set the link slave latency which allows the peripheral to only reply to every 2, 5, 10 or n-th packet if it does not have any data to send to the central. 

    Best regards

    Bjørn

  • Actually in advertising side, you have two parameters named Min Interval and Maximum Interval, minimum interval is time for only advertising packet to be sent and maximum interval includes both advertising packet and scan response packet to be sent. you can play around with that to change the timings. Similarlly you have scanning window and scanning interval on the central device. if you set both of them equally it will scan continuously. 

    You can set the peripheral device not to send scan response even though it receives scan request, all you need to do is while setting data for advertising and scan-response you can send NULL pointer in place of scan response pointer. But, in central device if you send  scan request it will definetaly wait for scan response(I think playing with scanning window you can neglect the search for scanning response). But modifying the scan request is not possible.

    I think this will help you, but i am not sure. Sorry if i am worng.

Related