Add stats serializer.

This commit is contained in:
Ian Gulliver
2016-02-17 08:30:32 +00:00
parent 0db4d15897
commit a0d94a4198
9 changed files with 73 additions and 8 deletions

8
json.c
View File

@@ -14,7 +14,7 @@ void json_init() {
assert(JSON_INTEGER_IS_LONG_LONG);
}
static int json_buf_append_callback(const char *buffer, size_t size, void *data) {
int json_buf_append_callback(const char *buffer, size_t size, void *data) {
struct buf *buf = data;
if (size > BUF_LEN_MAX - buf->length - 1) {
return -1;
@@ -70,9 +70,6 @@ void json_serialize(struct packet *packet, struct buf *buf) {
}
switch (packet->type) {
case MODE_AC:
break;
case MODE_S_SHORT:
json_serialize_mode_s_short(packet, buf);
break;
@@ -80,5 +77,8 @@ void json_serialize(struct packet *packet, struct buf *buf) {
case MODE_S_LONG:
json_serialize_mode_s_long(packet, buf);
break;
case NUM_TYPES:
break;
}
}