Kallisto Linux API
Library for interacting with Kallisto devices
SensorProvider Class Referenceabstract
Inheritance diagram for SensorProvider:

Public Member Functions

 SensorProvider ()
 
virtual ~SensorProvider ()
 
virtual std::vector< std::unique_ptr< SensorImpl > > provide (Kallisto &kallisto, const std::map< std::string, std::vector< uint8_t >> &service_data, const std::map< uint16_t, std::vector< uint8_t > > &manufacturer_data, util::Executor &event_dispatcher, bluetooth::BluetoothDispatcher &bluetooth_dispatcher, TimeSynchronizer &sensor_synchonizer)=0
 

Constructor & Destructor Documentation

◆ SensorProvider()

Constructor

◆ ~SensorProvider()

virtual ~SensorProvider ( )
virtual

Destructor

Member Function Documentation

◆ provide()

virtual std::vector<std::unique_ptr<SensorImpl> > provide ( Kallisto kallisto,
const std::map< std::string, std::vector< uint8_t >> &  service_data,
const std::map< uint16_t, std::vector< uint8_t > > &  manufacturer_data,
util::Executor event_dispatcher,
bluetooth::BluetoothDispatcher bluetooth_dispatcher,
TimeSynchronizer sensor_synchonizer 
)
pure virtual

Should provide a list of sensors, if they are present in the device.

The parameter manufacturer_data should be used to check if a device contains a given sensor so a custom device should advertise which sensors are available.

If BluetoothScannerConfiguration#getLegacyDiscovery() is disabled, all BLE operations requested to the BluetoothDispatcher will fail and the calls BluetoothDispatcher#getServices() and BluetoothDispatcher#getCharacteristics(UUID) will report empty data.

If BluetoothScannerConfiguration#getLegacyDiscovery() is enabled, BLE operations can used to identify the available sensors by using their UUID, for example.

Parameters
kallistoThe device under discovery.
service_dataThe advertised service data of the device. Each key represent an UUID and each value is a byte array of the service data. Will be empty if there was no data.
manufacturer_dataThe advertised manufacturer data of the device. Each key represents an company ID and each value is a byte array of the service data.
event_dispatcherInterface for the sensors to send events. The sensor should run the callbacks using this executor.
bluetooth_dispatcherInterface to perform BLE operations. Should be saved to allow interaction with the remote device.
sensor_synchonizerInterface to sync the sensor events timestamps.
Returns
A list of sensors available in the device

Implemented in KallistoSensorProvider.


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