#ifndef _JSON_INTERFACE_H #define _JSON_INTERFACE_H #define INTERFACE_VERSINO (1) #include "object_manager.h" typedef enum { OBJ_CMD_ADD = 100, OBJ_CMD_MOD = 101, OBJ_CMD_DEL = 102, OBJ_CMD_QUERYLIST = 103, OBJ_CMD_QUERYDETAIL = 104, } JSON_CMD; typedef enum { JE_INTERFACE, JE_OBJ_ADD, JE_OBJ_MOD, JE_OBJ_DEL, JE_OBJ_QUERYLIST, JE_OBJ_QUERYDETAIL, JSON_ENGINE_MAX, } JSON_ENGINE_TYPE; #ifdef __cplusplus extern "C" { #endif typedef struct { int cmdId; int ver; int cryptoType; int timeStamp; const char *msgContent; } JSON_INTERFACE, *PJSON_INTERFACE; typedef struct { PCMHI_OBJECT pObj; OBJECT_K objk; } IFC_ADD_CTX, *PIFC_ADD_CTX; typedef struct { PIFC_ADD_CTX pCtx; int n_obj; } IFACE_ADD_OBJ, *PIFACE_ADD_OBJ; typedef struct { char name[100][MAX_NAME_LEN]; int n_obj; } IFACE_DEL_OBJ, *PIFACE_DEL_OBJ; typedef struct { char *name; char *mesg; int ret_code; } IFC_RET_LIST, *PIFC_RET_LIST; typedef struct { int ret_code; char *mesg; int n_items; IFC_RET_LIST data[100]; } IFC_RET_MSG, *PIFC_RET_MSG; int Json2Struct(const char *pJsonStr, void *pData, JSON_ENGINE_TYPE type, int enBase64); const char *Struct2Json(void *pStruct, JSON_ENGINE_TYPE type, int enBase64, int *pErr); #ifdef __cplusplus } #endif #endif