File Information
Library: IoT/BtLE
Package: BtLE
Header: IoT/BtLE/PeripheralBrowser.h
Description
This class provides browsing (scanning) for available Bt LE devices.
Member Summary
Member Functions: browse, browseInProgress, cancelBrowse
Types Aliases
Ptr
using Ptr = Poco::SharedPtr < PeripheralBrowser >;
Destructor
~PeripheralBrowser
virtual ~PeripheralBrowser();
Destroys the PeripheralBrowser.
Member Functions
browse
virtual void browse(
bool activeScan = false
) = 0;
Scan for peripherals.
If activeScan is true, an active scan will be performed, otherwise a passive scan. Full advertising data will only be provided in an active scan. Advertising data for a passive scan is limited to at most 31 bytes. For extended advertising data provided by an active scan, the maximum size is 1650 bytes.
Any peripherals found will be reported through the peripheralFound event. Scanning for peripherals will be done asynchronously, therefore this method returns immediately.
An active scan will stop automatically after some time, firing the browseComplete event. A passive scan will go on until canceled by calling cancelBrowse().
If a browse is already in progress, throws a Poco::IllegalStateException.
browseInProgress
virtual bool browseInProgress() = 0;
Returns true if a browse (scan) is currently in progress, otherwise false.
cancelBrowse
virtual void cancelBrowse() = 0;
Cancels an ongoing browse operation.
Variables
browseComplete
Poco::BasicEvent < void > browseComplete;
Fired when browsing has been completed.
browseError
Poco::BasicEvent < const std::string > browseError;
Fired when an error was encountered during browsing.
browseStarted
Poco::BasicEvent < void > browseStarted;
Fired when browsing has been started.
peripheralFound
Poco::BasicEvent < const PeripheralInfo > peripheralFound;
Fired when a peripheral has been found during browsing.