json.h 612 Bytes
#ifndef JSON_H
#define JSON_H

#include <string.h>
#include <stdint.h>
#include "http.h"
#include "libwismart.h"
#include "ch.h"

#define	JSON_POST_OK		0
#define	JSON_COMM_ERROR		1
#define JSON_OTHER_ERROR	2

#define JOIN_NO_FREE		0
#define JOIN_FREE_MEM		1

char* prepare_json_statement(char** data, uint32_t nObservations);
char* prepare_observation(char* observation, uint32_t length);
uint8_t send_json(char* statement, uint32_t length, char* ID);
uint32_t find_next_index(char* string, uint32_t length, char delimiter);
char* join_strings(char* str1, char* str2, uint32_t len1, uint32_t len2, bool)

#endif