parent
68ab2cbf93
commit
f7af50861d
Platform/user/configm/config-server/LTE_config
|
@ -63,12 +63,12 @@ ret_code LTE_config_init(void)
|
|||
|
||||
/*
|
||||
{
|
||||
"operate":set,
|
||||
"action":start
|
||||
"operate":"set",
|
||||
"action":"start"
|
||||
}
|
||||
|
||||
{
|
||||
"operate":getall
|
||||
"operate":"getall"
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -91,20 +91,23 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
|
|||
rpc_json_print(json_obj);
|
||||
|
||||
cJSON *operate = cJSON_GetObjectItem(json_obj,"operate");
|
||||
|
||||
if((NULL == operate) || (NULL == (operate->valuestring)))
|
||||
{
|
||||
cJSON_Delete(json_obj);
|
||||
return RET_EMPTY_STRING;
|
||||
}
|
||||
|
||||
|
||||
rpc_log_info("operate is %s\n",operate->valuestring);
|
||||
|
||||
if(strcmp(operate->valuestring,"set") == 0)
|
||||
{
|
||||
*conf_type = CM_CONFIG_SET;
|
||||
}
|
||||
if(strcmp(operate->valuestring,"getall") == 0)
|
||||
else if(strcmp(operate->valuestring,"getall") == 0)
|
||||
{
|
||||
*conf_type = CM_CONFIG_GET_ALL;
|
||||
cJSON_Delete(json_obj);
|
||||
return RET_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -112,6 +115,7 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
|
|||
return RET_INPUTERR;
|
||||
}
|
||||
|
||||
rpc_log_info("config type is %d\n",*conf_type);
|
||||
cJSON *action_type;
|
||||
action_type = cJSON_GetObjectItem(json_obj,"action");
|
||||
if((NULL == action_type) || (NULL == (action_type->valuestring)))
|
||||
|
@ -121,6 +125,7 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
|
|||
}
|
||||
else
|
||||
{
|
||||
rpc_log_info("action is %s\n",action_type->valuestring);
|
||||
if(strcmp(action_type->valuestring,"start") == 0)
|
||||
{
|
||||
g_action = START;
|
||||
|
@ -133,10 +138,6 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
|
|||
{
|
||||
g_action = STOP;
|
||||
}
|
||||
else if(strcmp(action_type->valuestring,"status") == 0)
|
||||
{
|
||||
g_action = STATUS;
|
||||
}
|
||||
else
|
||||
{
|
||||
cJSON_Delete(json_obj);
|
||||
|
@ -144,6 +145,8 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
|
|||
}
|
||||
}
|
||||
|
||||
rpc_log_info("action type is %d\n",g_action);
|
||||
cJSON_Delete(json_obj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue