16 class ScannedPeripheral;
38 std::shared_ptr<Systemic::BluetoothLE::Scanner> _scanner{};
40 std::vector<std::shared_ptr<const ScannedPixel>> _scannedPixels{};
43 std::recursive_mutex _mutex{};
60 return _scanner !=
nullptr;
70 std::lock_guard lock{ _mutex };
72 outScannedPixels.reserve(outScannedPixels.size() + _scannedPixels.size());
73 for (
auto& p : _scannedPixels)
75 outScannedPixels.emplace_back(p);
Represents a Bluetooth scanner for Pixels dice.
Definition: PixelScanner.h:29
void stop()
Stops scanning for Pixels.
void copyScannedPixels(std::vector< std::shared_ptr< const ScannedPixel > > &outScannedPixels)
Copy the list of scanned Pixels to the given std::vector.
Definition: PixelScanner.h:68
std::function< void(const std::shared_ptr< const ScannedPixel > &)> ScannedPixelListener
Signature of a scanned Pixel listener.
Definition: PixelScanner.h:32
bool isScanning()
Indicates whether a scan for Pixels dice is currently running.
Definition: PixelScanner.h:58
PixelScanner(const ScannedPixelListener &listener)
Initializes a new instance of PixelScanner with the given listener.
void start()
Starts a Bluetooth scan for Pixels.
~PixelScanner()
Default destructor.
void clear()
Clear the list of scanned Pixels.
A collection of C++ classes that provides a simplified access to Bluetooth Low Energy peripherals.
Definition: BleTypes.h:38
A collection of C++ classes and types to scan for and connect to Pixels dice.
Definition: Helpers.h:13