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

#include <sensor_event_listener.hpp>

Public Member Functions

 SensorEvent (std::chrono::nanoseconds _timestamp, std::vector< float > _values)
 
 ~SensorEvent ()
 

Data Fields

std::chrono::nanoseconds timestamp
 
std::vector< float > values
 

Detailed Description

Class that encapsulates a sensor event.

Constructor & Destructor Documentation

◆ SensorEvent()

SensorEvent ( std::chrono::nanoseconds  _timestamp,
std::vector< float >  _values 
)

SensorEvent constructor.

◆ ~SensorEvent()

SensorEvent destructor.

Field Documentation

◆ timestamp

std::chrono::nanoseconds timestamp

The time at which the event happened in nanoseconds.

This time is generated by the Kallisto device and synchronized with the wall clock.

Since the transport layer is the Bluetooth Low Energy, there will be delays to the event delivery. A event generated will be delayed by the BLE connection (refer to the Bluetooth specification for details) and by queuing in the device side. Expect delays, in average, of about 100 ms.

◆ values

std::vector<float> values

The length and contents of the values vector depends on which KallistoSensor type is being monitored.

Each sensor has different type of values reported:

KallistoSensor::SensorType::ACCELEROMETER}:

All values are in SI units (m/s^2)

  • values[0]: Acceleration minus Gx on the x-axis
  • values[1]: Acceleration minus Gy on the y-axis
  • values[2]: Acceleration minus Gz on the z-axis

KallistoSensor::SensorType::MAGNETIC_FIELD}:

All values are in micro-Tesla (uT) and measure the ambient magnetic field in the X, Y and Z axis.

KallistoSensor::SensorType::GYROSCOPE}:

All values are in rad/s in the X, Y and Z axis.

  • values[0]: Angular speed around the x-axis
  • values[1]: Angular speed around the y-axis
  • values[2]: Angular speed around the z-axis

KallistoSensor::SensorType::BATTERY_SOC}:

Reports a single value between 0 and 100 that represents the state-of-charge. Only changes are reported.

KallistoSensor::SensorType::BATTERY_CHARGING_STATUS}:

Reports a single value (0 or 1) that represents if the battery is charging. Only changes are reported.

KallistoSensor::SensorType::RSSI}:

Reports a single value in dBm.


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