C++ Pixels Library For Windows
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
Systemic::Pixels::PixelScanner Class Reference

Represents a Bluetooth scanner for Pixels dice. More...

#include <PixelScanner.h>

Public Types

using ScannedPixelListener = std::function< void(const std::shared_ptr< const ScannedPixel > &)>
 Signature of a scanned Pixel listener.
 

Public Member Functions

 PixelScanner (const ScannedPixelListener &listener)
 Initializes a new instance of PixelScanner with the given listener. More...
 
 ~PixelScanner ()
 Default destructor.
 
bool isScanning ()
 Indicates whether a scan for Pixels dice is currently running.
 
void copyScannedPixels (std::vector< std::shared_ptr< const ScannedPixel > > &outScannedPixels)
 Copy the list of scanned Pixels to the given std::vector. More...
 
void start ()
 Starts a Bluetooth scan for Pixels.
 
void stop ()
 Stops scanning for Pixels.
 
void clear ()
 Clear the list of scanned Pixels.
 

Detailed Description

Represents a Bluetooth scanner for Pixels dice.

This class is thread safe.

Constructor & Destructor Documentation

◆ PixelScanner()

Systemic::Pixels::PixelScanner::PixelScanner ( const ScannedPixelListener listener)
explicit

Initializes a new instance of PixelScanner with the given listener.

Parameters
listenerA function to be called upon each Pixel advertisement packet received by the scanner.
Note
The given listener should not block the thread and completes its operation quickly.

Member Function Documentation

◆ copyScannedPixels()

void Systemic::Pixels::PixelScanner::copyScannedPixels ( std::vector< std::shared_ptr< const ScannedPixel > > &  outScannedPixels)

Copy the list of scanned Pixels to the given std::vector.

Parameters
outScannedPixelsThe std::vector to which the scanned Pixels are copied (appended).

The documentation for this class was generated from the following file: