Mod aaa-12 修改LTE模块

RCA:
SOL:
修改人:tongyebin
检视人:
This commit is contained in:
tongyebin 2019-10-10 17:56:00 +08:00
parent 7c88c96040
commit 6585bb5bd0
3 changed files with 19 additions and 12 deletions

View File

@ -18,9 +18,9 @@ typedef enum{
LOCALAUTH_CONFIG_MODULE = 0x00000003, ///< PORTAL SERVER CONFIG
LOG_CONFIG_MODULE = 0x00000004, ///<
VLAN_CONFIG_MODULE = 0x00000005, ///< vlan config
DHCP_CONFIG_MODULE = 0x00000007, ///< DHCP CONFIG
LTE_CONFIG_MODULE = 0x00000008, ///< 4G config
NAT_CONFIG_MODULE = 0x00000009, ///< nat config
DHCP_CONFIG_MODULE = 0x00000006, ///< DHCP CONFIG
LTE_CONFIG_MODULE = 0x00000007, ///< 4G config
NAT_CONFIG_MODULE = 0x00000008, ///< nat config
STATIC_ROUTING_CONFIG_MODULE = 0x00000009, ///< static routing
OBJECT_MANAGER_CONFIG_MODULE = 0x0000000A, ///< Object manager config id

View File

@ -59,7 +59,7 @@ typedef unsigned int ret_code;
#define RET_GATEWAY_ERR (unsigned int)((unsigned int)STATIC_ROUTING_CONFIG_MODULE<<16|9)
#define RET_GW_DEV_ERR (unsigned int)((unsigned int)STATIC_ROUTING_CONFIG_MODULE<<16|10)
/* LTE_CONFIG_MODULE 0x00100000 ~ 0x0010ffff*/
/* LTE_CONFIG_MODULE 0x00070000 ~ 0x0007ffff*/
#define RET_EXEC_SHELL_ERR (unsigned int)((unsigned int)LTE_CONFIG_MODULE<<16|1)
#define RET_NULL_INPUT_ERR (unsigned int)((unsigned int)LTE_CONFIG_MODULE<<16|2)
#define RET_LTE_NO_MATCH_ERR (unsigned int)((unsigned int)LTE_CONFIG_MODULE<<16|3)

View File

@ -51,6 +51,7 @@ ret_code LTE_config_init(void)
while(fgets(result,sizeof(result),f) != NULL)
{
rpc_log_info("%s\n",result);
ret = compare(result);
memset(result,sizeof(result),0);
fseek(f,0,SEEK_CUR);
@ -189,18 +190,20 @@ ret_code start_lte()
fgets(result,sizeof(result),f);
if(strcmp(result,"not install lte! ") == 0)
rpc_log_info("%s\n",result);
if(strstr(result,"not install lte") != NULL )
{
pclose(f);
return RET_NO_LTE_MODULE_ERR;
}
else if(strcmp(result,"pppd apparently already active, start aborted!") == 0)
else if(strstr(result,"pppd apparently already active") != NULL)
{
pclose(f);
return RET_ALREADY_START_ERR;
}
else if(strcmp(result,"start pppd ppp0") == 0)
else if(strstr(result,"start pppd ppp0") != NULL)
{
while(i < 120)
{
@ -246,13 +249,15 @@ ret_code stop_lte()
fgets(result,sizeof(result),f);
if(strcmp(result,"pppd may be sotped already") == 0)
rpc_log_info("%s\n",result);
if(strstr(result,"pppd may be sotped already") != NULL)
{
pclose(f);
return RET_ALREADY_STOP_ERR;
}
else if((strcmp(result,"stop pppd ppp0") == 0) && access(file_path,0) != 0)
else if((strstr(result,"stop pppd ppp0") != NULL) && access(file_path,0) != 0)
{
pclose(f);
return RET_OK;
@ -285,18 +290,20 @@ ret_code restart_lte()
fseek(f,0,SEEK_CUR);
fgets(result,sizeof(result),f);
if(strcmp(result,"not install lte! ") == 0)
rpc_log_info("%s\n",result);
if(strstr(result,"not install lte! ") != NULL)
{
pclose(f);
return RET_NO_LTE_MODULE_ERR;
}
else if(strcmp(result,"pppd apparently already active, start aborted!") == 0)
else if(strstr(result,"pppd apparently already active, start aborted!") != NULL)
{
pclose(f);
return RET_ALREADY_START_ERR;
}
else if(strcmp(result,"start pppd ppp0") == 0)
else if(strstr(result,"start pppd ppp0") != NULL)
{
while(i < 120)
{