13 lines
353 B
C
13 lines
353 B
C
#ifndef TEMPSENSE_H
|
|
#define TEMPSENSE_H
|
|
#include <stddef.h>
|
|
|
|
typedef struct { char sensor[32]; double celsius; } Reading;
|
|
|
|
double to_fahrenheit(double celsius);
|
|
int parse_reading(const char *json, Reading *out); /* 0 on success */
|
|
int format_reading(const Reading *in, char *buf, size_t len);
|
|
double clamp_to_absolute_zero(double celsius);
|
|
|
|
#endif
|