esp8266-std/include/jsprase.h

34 lines
933 B
C

#ifndef JSPRASE_H
#define JSPRASE_H
typedef enum
{
JE_PROMAIN = 0,
JE_BYPASS,
JE_SHADOWUP,
//******************************************
// App <--> WIFI Module
//******************************************
JE_GETID,
JE_CFG_AP,
JE_RSP_STATUS,
JE_GLOBAL_CFG,
JE_USER_CFG,
JE_MAX,
} JSON_ENGINE_TYPE;
typedef const char* (*JSONENCODEPROC)(void* pStruct);
typedef void* (*JSONDECODEPROC)(const char* pJsonStr);
typedef void (*CRYPTOPROC)(void *pStruct, int cryptoType, int enCode);
typedef struct
{
JSON_ENGINE_TYPE typeId;
JSONENCODEPROC jsonEncodeCb;
JSONDECODEPROC jsonDecodeCb;
CRYPTOPROC cryptoCb;
} JSON_ENGINE, *PJSON_ENGINE;
const char* Struct2Json(void* pStruct, JSON_ENGINE_TYPE type, int cryptoType, int* pErr);
void* Json2Struct(const char* pJsonStr, JSON_ENGINE_TYPE type, int cryptoType, int* pErr);
#endif