fetcher 0.0.0
A command line utility for reading sensor data over I2C and providing it over stdout.
|
#include <sensor_api.h>
Data Fields | |
SensorLocation | loc |
SensorTagList | tag_list |
SensorContext | context |
SensorPrecision | precision |
errno_t(* | open )(struct sensor_t *sensor) |
errno_t(* | read )(struct sensor_t *sensor, const SensorTag tag, void *buf, size_t *nbytes) |
The generic interface to interact with all sensors.
SensorContext Sensor::context |
Data structure for the sensor to store context it needs between operations.
SensorLocation Sensor::loc |
The I2C address and bus of the sensor.
errno_t(* Sensor::open) (struct sensor_t *sensor) |
Function responsible for opening and setting up the sensor.
sensor | The sensor who this open method belongs to. |
SensorPrecision Sensor::precision |
What precision the sensor should measure. Can be changed between reads.
errno_t(* Sensor::read) (struct sensor_t *sensor, const SensorTag tag, void *buf, size_t *nbytes) |
Function responsible for reading the data associated with tag from the sensor.
sensor | The sensor who this read method belongs to. |
tag | The tag of the data type that should be read. |
buf | A pointer to the memory location to store the data. Should be large enough to fit the max_return_size bytes. |
nbytes | The number of bytes that were written into the byte array buffer. |
SensorTagList Sensor::tag_list |
A list of all the tags the sensor is capable of reading.