Files
P4-USB-transfer/main/JSON/json.c
T
zhengxinandCursor 851e347cf5 初始提交卡包 USB 工程
纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-13 21:54:50 +08:00

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
}
}