mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 04:58:17 +08:00
fix:cjson归档
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
NAME := App_TC1
|
NAME := App_TC1
|
||||||
|
|
||||||
$(NAME)_SOURCES := main.c\
|
$(NAME)_SOURCES := main.c\
|
||||||
cJSON.c\
|
cJSON/cJSON.c\
|
||||||
user_wifi.c\
|
user_wifi.c\
|
||||||
user_key.c\
|
user_key.c\
|
||||||
user_sntp.c\
|
user_sntp.c\
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "user_key.h"
|
#include "user_key.h"
|
||||||
#include "cJSON.h"
|
#include "cJSON/cJSON.h"
|
||||||
|
|
||||||
typedef struct _user_json_context_t
|
typedef struct _user_json_context_t
|
||||||
{
|
{
|
||||||
@@ -28,9 +28,9 @@ void user_function_cmd_received( uint8_t *pusrdata )
|
|||||||
cJSON *p_name = cJSON_GetObjectItem( pJsonRoot, "name" );
|
cJSON *p_name = cJSON_GetObjectItem( pJsonRoot, "name" );
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(p_idx && cJSON_IsNumber( p_idx ) && p_idx->valueint == 2)
|
(p_idx && cJSON_IsNumber( p_idx ) && p_idx->valueint == 2) //idx
|
||||||
|| (p_description && cJSON_IsString( p_description ) && strcmp( p_description->valuestring, "123" ) == 0)
|
|| (p_description && cJSON_IsString( p_description ) && strcmp( p_description->valuestring, "123" ) == 0) //description mqttid
|
||||||
|| (p_name && cJSON_IsString( p_name ) && strcmp( p_name->valuestring, sys_config->micoSystemConfig.name ) == 0)
|
|| (p_name && cJSON_IsString( p_name ) && strcmp( p_name->valuestring, sys_config->micoSystemConfig.name ) == 0) //name
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cJSON *p_nvalue = cJSON_GetObjectItem( pJsonRoot, "nvalue" );
|
cJSON *p_nvalue = cJSON_GetObjectItem( pJsonRoot, "nvalue" );
|
||||||
|
|||||||
Reference in New Issue
Block a user