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

Peripheral device having ability to do both scanning and advertising

Hi Nordic Team,

In my BLE project, the peripheral device has the ability to do both scanning and advertising. So please suggest a way of how the central device would know if the peripheral device is acting currently in scanning mode or advertising mode. Please help as soon as possible.

Thanks & Regards,

Aswati 

  • Hi Aswati,

    There is no way a BLE device can know if another BLE device is scanning. The exception is if the other device is doing active scanning, but in that case, only the peripheral which is actively scanned will know, unless it acts as a sniffer). It follows that since your central device is an nRF device which is only a central, it cannot know that the other device is scanning.

    So the only option that is left is if you know that the peripheral device is always either scanning or advertising. In that case, your central device can scan continuously and if it does not detect advertisement packets, it can assume that the peripheral device is scanning. But there could be other reasons for not receiving the packets as well, so you have no guarantees. Also, continuously scanning results in high power consumption, so it is not viable for a battery-powered device where you want a long battery life.

    Einar

Related