Kallisto Linux API
Library for interacting with Kallisto devices
BluetoothScannerFilter Class Reference

#include <bluetooth_scanner_filter.hpp>

Data Structures

class  Builder

Public Member Functions

 ~BluetoothScannerFilter ()
 BluetoothScannerFilter (const BluetoothScannerFilter &filter)
BluetoothScannerFilteroperator= (const BluetoothScannerFilter &filter)
 BluetoothScannerFilter (BluetoothScannerFilter &&configuration)
BluetoothScannerFilteroperator= (BluetoothScannerFilter &&configuration)
bool filter (std::string name, std::string mac)

Detailed Description

This class represents a Scanner filter.

A scanner filter allows the developer to filter un-wanted devices that are not compatible with the system using naming and MAC criteria.

Use the Builder class to get a valid configuration.

See also

Constructor & Destructor Documentation

◆ ~BluetoothScannerFilter()

◆ BluetoothScannerFilter() [1/2]

Copy Constructor.

◆ BluetoothScannerFilter() [2/2]

Move Constructor.

Member Function Documentation

◆ filter()

bool filter ( std::string  name,
std::string  mac 

Checks if the passed parameters are compliant with this filter.

Several criteria can be configured:

  • Inclusive MAC list - If the passed MAC is in the list, it passes the filter;
  • Exclusive MAC list - If the passed MAC is in the list, it doesn't pass the filter;
  • Inclusive name list - If the passed name contains an inclusive name and no exclusive name, it passes the filter;
  • Exclusive name list - If the passed name doesn't contain an exclusive name, it passes the filter.

TODO: A device with Constants#KALLISTO_DFU_NAME always passes the filter.

There are some priorities relating the filters since it isn't obligatory to configure all lists. If there is any MAC in an inclusive MAC list, this list decides the outcome. If this list is empty, next it evaluates the exclusive MAC list. If the MAC passes this list, the name lists are evaluated next.

If no list is configured, all devices pass the filter.

nameThe advertising name.
macThe MAC address. Should follow the MAC_PATTERN.
if the device complies with the filter.

◆ operator=() [1/2]

BluetoothScannerFilter& operator= ( const BluetoothScannerFilter filter)

Copy assigment operator.

◆ operator=() [2/2]

BluetoothScannerFilter& operator= ( BluetoothScannerFilter &&  configuration)

Move assigment operator.

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