AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_json.h
Go to the documentation of this file.
1
6#ifndef _LIB_JSON_H
7#define _LIB_JSON_H
8
9#include "stdutils.h"
10#include "lib_config.h"
11
12#define LENGTH_KEY_SIZE 32 //Max 3-char keyStr ex:"typ", "dat", "cmd", "sts" etc
13
17typedef struct
18{
19 char keyStr[LENGTH_KEY_SIZE];
20 char *pValueStr;
22
23#define MAX_JSON_ARRAY_OBJS 10
24
28typedef struct
29{
31 char jsonObjs[MAX_JSON_ARRAY_OBJS][150];
33
43bool JSON_processString(const char *pJsonStr, const tagStructure_st tags[], uint8_t maxKeys_u8);
44
53uint8_t JSON_processArrayObjs(char *pJsonStr, jsonArray_st *jsnArrPtr);
54
55#endif
Configuration header file.
uint8_t JSON_processArrayObjs(char *pJsonStr, jsonArray_st *jsnArrPtr)
Extract an array of JSON objects from given JSON string.
bool JSON_processString(const char *pJsonStr, const tagStructure_st tags[], uint8_t maxKeys_u8)
Extract the key-value pairs sepcified by tags from a give JSON string.
A structure to represent array of JSON objects.
Definition: lib_json.h:29
uint8_t numOfJosnObjs_u8
Definition: lib_json.h:30
A structure to represent key-value pairs in a JSON string.
Definition: lib_json.h:18
char * pValueStr
Definition: lib_json.h:20