12 lines
475 B
C
12 lines
475 B
C
#ifndef TELEMETRY_H
|
|
#define TELEMETRY_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef enum { FRAME_OK, FRAME_SHORT, FRAME_VERSION, FRAME_CRC, FRAME_RANGE,
|
|
FRAME_DUPLICATE, FRAME_ROLLBACK } frame_result_t;
|
|
typedef struct { uint16_t sequence; int16_t temperature_centi; uint16_t voltage_mv; } sample_t;
|
|
frame_result_t decode_frame(const uint8_t *bytes, size_t length, sample_t *sample);
|
|
const char *frame_result_name(frame_result_t result);
|
|
#endif
|