|
ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
|
Go to the source code of this file.
Functions | |
| bool | MetadataEqual (Metadata *left, Metadata *right) |
| Compares two Metadata structures for equality. | |
| unsigned int | Format (RepeatedSensorMeasurements *meas) |
| Optimizes repeated sensor measurements for size. | |
| SensorStatus | Parse (RepeatedSensorMeasurements *meas) |
| Parses repeated sensor measurements to add metadata back to individual measurements. | |
| void | PrintMetadata (const Metadata *meta) |
| SensorStatus | FormatRepeatedSensorMeasurements (Metadata meta, const SensorMeasurement meas[], size_t count, RepeatedSensorMeasurements *out) |
| SensorStatus | EncodeSensorMeasurement (const SensorMeasurement *meas, uint8_t *buffer, size_t *size) |
| Encodes a single sensor measurement into a buffer. | |
| SensorStatus | EncodeRepeatedSensorMeasurements (Metadata meta, const SensorMeasurement meas[], size_t count, uint8_t *buffer, size_t size, size_t *length) |
| Encodes multiple sensor measurements into a buffer. | |
| SensorStatus | RepeatedSensorMeasurementsSize (Metadata meta, const SensorMeasurement meas[], size_t count, size_t *size) |
| Gets the size of multiple repeated sensor measurements when encoded. | |
| SensorStatus | EncodeUint32Measurement (Metadata meta, uint32_t value, SensorType type, uint8_t *buffer, size_t *size) |
| Encodes a uint64_t sensor measurement into a buffer. | |
| SensorStatus | EncodeInt32Measurement (Metadata meta, int32_t value, SensorType type, uint8_t *buffer, size_t *size) |
| Encodes an int64_t sensor measurement into a buffer. | |
| SensorStatus | EncodeDoubleMeasurement (Metadata meta, double value, SensorType type, uint8_t *buffer, size_t *size) |
| Encodes a double sensor measurement into a buffer. | |
| SensorStatus | DecodeSensorMeasurement (const uint8_t *data, const size_t len, SensorMeasurement *meas) |
| Decodes a sensor measurement from a buffer. | |
| SensorStatus | DecodeRepeatedSensorMeasurements (const uint8_t *data, const size_t len, RepeatedSensorMeasurements *measurements) |
| Decodes multiple sensor measurements from a buffer. | |
| SensorStatus | EncodeRepeatedSensorResponses (const RepeatedSensorResponses responses, uint8_t *buffer, size_t *size) |
| Encodes multiple sensor responses into a buffer. | |
| SensorStatus | DecodeRepeatedSensorReponses (const uint8_t *data, const size_t len, RepeatedSensorResponses *resp) |
| Decodes multiple sensor responses from a buffer. | |
| SensorStatus | CheckSensorResponse (const SensorResponse *resp) |
| Checks a single sensor response for errors. | |
| void | PrintSensorMeasurement (const SensorMeasurement *m) |
| void | PrintRepeatedSensorMeasurements (const RepeatedSensorMeasurements *msg) |
| unsigned int Format | ( | RepeatedSensorMeasurements * | meas | ) |
Optimizes repeated sensor measurements for size.
Places duplicate metadata fields into the top level "meta" field.
| meas | Pointer to the RepeatedSensorMeasurements to optimize. |
Definition at line 59 of file sensor.c.
References i, and MetadataEqual().
Referenced by FormatRepeatedSensorMeasurements().
| SensorStatus FormatRepeatedSensorMeasurements | ( | Metadata | meta, |
| const SensorMeasurement | meas[], | ||
| size_t | count, | ||
| RepeatedSensorMeasurements * | out | ||
| ) |
Definition at line 124 of file sensor.c.
References Format(), i, SENSOR_OK, and SENSOR_OUT_OF_BOUNDS.
Referenced by EncodeRepeatedSensorMeasurements(), and RepeatedSensorMeasurementsSize().
| bool MetadataEqual | ( | Metadata * | left, |
| Metadata * | right | ||
| ) |
| SensorStatus Parse | ( | RepeatedSensorMeasurements * | meas | ) |
Parses repeated sensor measurements to add metadata back to individual measurements.
| meas | Pointer to the RepeatedSensorMeasurements to parse. |
Definition at line 103 of file sensor.c.
References i, SENSOR_ERROR, and SENSOR_OK.
Referenced by DecodeRepeatedSensorMeasurements().
| void PrintMetadata | ( | const Metadata * | meta | ) |
Definition at line 332 of file sensor.c.
Referenced by PrintRepeatedSensorMeasurements(), and PrintSensorMeasurement().