纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。 Co-authored-by: Cursor <[email protected]>
36 lines
836 B
C
36 lines
836 B
C
#include "cJSON.h"
|
|
#include "json.h"
|
|
|
|
// KEY_VALUE_PAIR data_pair =
|
|
// {
|
|
// .key = "action",
|
|
// .value = NULL,
|
|
// .son1_pair =
|
|
// }
|
|
|
|
void json_create(const char *str)
|
|
{
|
|
|
|
cJSON *report_msg = cJSON_CreateObject();
|
|
cJSON_AddStringToObject(report_msg, "action", "message");
|
|
cJSON_AddStringToObject(report_msg, "target_id", "0");
|
|
cJSON *data = cJSON_CreateObject();
|
|
cJSON_AddStringToObject(data, "status", "download_finish_ok");
|
|
cJSON_AddItemToObject(report_msg, "data", data);
|
|
char *report_str = cJSON_PrintUnformatted(report_msg);
|
|
|
|
}
|
|
|
|
|
|
cJSON* json_create_any_type(int type,cJSON *root, const char *key, const char *value)
|
|
{
|
|
cJSON *root = cJSON_CreateObject();
|
|
switch(type)
|
|
{
|
|
case 1://string
|
|
|
|
|
|
}
|
|
}
|
|
|