我已经建立了一个broadcasting device in non-connectable mode using the easy_gap API. It works, but I would like to detect if an active scanner is nearby without providing connections
Is there a way to detect that (or get notified if) the scan response packet is requested from an external (active) scanner? Even if there is no official API supporting this I'm satisfied if there is an indirect way, for example timing, memory usage...
Keywords:
Device:
Hi pontush,
There are theADV_SCAN_INDpackets (scannable undirected advertising), those packets are non-connectable and you will be able to send scan response data in the case of a scan request. In order to activate those kind of packets in the SDK you will have to set the scan response data and the SDK will send those kind of packets. But there is no detection if there is an active scanner in the area, the peripheral will always have the receiver open (i mean when transmitting data during the advertising triplet it will also open the receiver for hearing scan requests). So the device will always send scan responses when it gets an scan request.
Thanks MT_dialog
Hi,
Yes I understand this, the stack handles listening to scan requests and automatic transmission of scan responses if provided by the application. I was hoping there was a way to detect from the application that this has happened and if so preferably the device address of the scanner (the ScanA field from the SCAN_REQ packet). If not available today I think it could be a nice feature in a future version of the SDK. A use case could, for example, be a beacon that lights up when approached by (active) scanners.
Hi pontush,
Thank you for the suggestion but i dont see how this is going to work, when in classic non-connectable advertising the device only transmits and never receives, so without any reception you wont be able track any scan requests from any active scanners. At least at the moment, as far as the undirected advertising is concern, there is no such feature in the SDK (to indicate to the application that a scan request is received).
Thanks MT_dialog