Kallisto Linux API
Library for interacting with Kallisto devices
|
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 |
SensorProvider | ( | ) |
Constructor
|
virtual |
Destructor
|
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.
kallisto | The device under discovery. |
service_data | The 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_data | The advertised manufacturer data of the device. Each key represents an company ID and each value is a byte array of the service data. |
event_dispatcher | Interface for the sensors to send events. The sensor should run the callbacks using this executor. |
bluetooth_dispatcher | Interface to perform BLE operations. Should be saved to allow interaction with the remote device. |
sensor_synchonizer | Interface to sync the sensor events timestamps. |
Implemented in KallistoSensorProvider.