Add sandbox_c cmake project + ccache workflow for pool testing
This commit is contained in:
1 parent
fb253f9b27
commit
ba41deb9ec
9 files changed
+160
No files matched your search
@@ -0,0 +1,7 @@
|
||||
#include "temperature.h"
|
||||
#include <stdio.h>
|
||||
int format_reading(const Reading *in, char *buf, size_t len) {
|
||||
if (!in || !buf || len < 16) return 1;
|
||||
int n = snprintf(buf, len, "{\"sensor\":\"%s\",\"celsius\":%.2f}", in->sensor, in->celsius);
|
||||
return (n < 0 || (size_t)n >= len) ? 2 : 0;
|
||||
}
|
||||
Reference in new issue
Block a user