13 #include "readings.pb.h"
14 #include "settings.pb.h"
16 PROCESS(serial_dumper_process,
"Serial Dumper");
18 AUTOSTART_PROCESSES(&serial_dumper_process);
25 static void dump_buffer(uint8_t *buffer, uint8_t len);
33 printf(
"+++SERIALDUMP+++NODEID+++\n");
36 printf(
"%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
39 lladdr->ipaddr.u8[10],
40 lladdr->ipaddr.u8[11],
41 lladdr->ipaddr.u8[12],
42 lladdr->ipaddr.u8[13],
43 lladdr->ipaddr.u8[14],
48 printf(
"+++SERIALDUMP+++SAMPLE+++START+++\n");
50 uint8_t buffer[Sample_size];
62 printf(
"+++SERIALDUMP+++SAMPLE+++END+++\n");
64 printf(
"+++SERIALDUMP+++CONFIG+++START+++\n");
66 uint8_t buffer[SensorConfig_size];
74 printf(
"+++SERIALDUMP+++CONFIG+++END+++\n");
81 for (i = 0; i < len; i++) {
82 printf(
"%02x", buffer[i]);
Header file for IPv6-related data structures.
#define PROCESS_END()
Define the end of a process.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
uint8_t store_get_raw_sample(uint16_t id, uint8_t buffer[Sample_size])
Get a given sample from the flash, in the form of an encoded protocol buffer.
Convenience layer for storing readings and the config.
Unicast address structure.
static void dump_buffer(uint8_t *buffer, uint8_t len)
Dump a binary buffer over serial as a hex line.
void store_init(void)
Initialize the data store.
uint8_t store_get_raw_config(uint8_t buffer[SensorConfig_size])
Get the configuration from the flash.
uint16_t store_get_latest_sample_id(void)
Get the identifer of the most recent sample stored.
#define PROCESS_BEGIN()
Define the beginning of a process.