parent
c39f0aa3e5
commit
b542df0675
|
@ -3,6 +3,7 @@
|
||||||
#include "parsefile.h"
|
#include "parsefile.h"
|
||||||
#include "LTE_config.h"
|
#include "LTE_config.h"
|
||||||
|
|
||||||
|
|
||||||
int g_action = 0;
|
int g_action = 0;
|
||||||
|
|
||||||
ret_code compare(char *result)
|
ret_code compare(char *result)
|
||||||
|
@ -207,7 +208,7 @@ ret_code start_lte()
|
||||||
{
|
{
|
||||||
while(i < 120)
|
while(i < 120)
|
||||||
{
|
{
|
||||||
if(access(file_path,0) != 0)
|
if(access(file_path,0) != -1)
|
||||||
{
|
{
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
i
++;
|
i
++;
|
||||||
|
@ -257,7 +258,7 @@ ret_code stop_lte()
|
||||||
return RET_ALREADY_STOP_ERR;
|
return RET_ALREADY_STOP_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((strstr(result,"stop pppd ppp0") != NULL) && access(file_path,0) != 0)
|
else if((strstr(result,"stop pppd ppp0") != NULL) && access(file_path,0) != -1)
|
||||||
{
|
{
|
||||||
pclose(f);
|
pclose(f);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
@ -307,7 +308,7 @@ ret_code restart_lte()
|
||||||
{
|
{
|
||||||
while(i < 120)
|
while(i < 120)
|
||||||
{
|
{
|
||||||
if(access(file_path,0) != 0)
|
if(access(file_path,0) != -1)
|
||||||
{
|
{
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
i
++;
|
i
++;
|
||||||
|
@ -386,8 +387,9 @@ ret_code status_lte(pointer output, int *output_len)
|
||||||
rpc_log_info("execuate cmd fail\n");
|
rpc_log_info("execuate cmd fail\n");
|
||||||
return RET_EXEC_SHELL_ERR;
|
return RET_EXEC_SHELL_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(result,sizeof(result),f);
|
fgets(result,sizeof(result),f);
|
||||||
|
rpc_log_info("%s\n",result);
|
||||||
if(strstr(result,"off") != NULL)
|
if(strstr(result,"off") != NULL)
|
||||||
{
|
{
|
||||||
strcpy(status,"off");
|
strcpy(status,"off");
|
||||||
|
@ -399,8 +401,9 @@ ret_code status_lte(pointer output, int *output_len)
|
||||||
else if(strstr(result,"on") != NULL)
|
else if(strstr(result,"on") != NULL)
|
||||||
{
|
{
|
||||||
strcpy(status,"on");
|
strcpy(status,"on");
|
||||||
memcpy(result,0,sizeof(result));
|
memset(result,0,sizeof(result));
|
||||||
fgets(result,sizeof(result),f);
|
fgets(result,sizeof(result),f);
|
||||||
|
rpc_log_info("%s\n",result);
|
||||||
sscanf(result,"ppp_keep_time=%d",&connect_time);
|
sscanf(result,"ppp_keep_time=%d",&connect_time);
|
||||||
ret = lte_to_json(status,connect_time,output,output_len);
|
ret = lte_to_json(status,connect_time,output,output_len);
|
||||||
pclose(f);
|
pclose(f);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
#define INIT_CMD "/etc/ppp/ppp-4G init"
|
#define INIT_CMD "/etc/ppp/ppp-4G init"
|
||||||
#define START_CMD "/etc/ppp/ppp-4G start"
|
#define START_CMD "/etc/ppp/ppp-4G start"
|
||||||
|
|
|
@ -40,10 +40,6 @@
|
||||||
DHCP_CONFIG_MODULE, \
|
DHCP_CONFIG_MODULE, \
|
||||||
dhcp_config_init \
|
dhcp_config_init \
|
||||||
}, \
|
}, \
|
||||||
{ \
|
|
||||||
LTE_CONFIG_MODULE, \
|
|
||||||
LTE_config_init \
|
|
||||||
}, \
|
|
||||||
{ \
|
{ \
|
||||||
OBJECT_MANAGER_CONFIG_MODULE, \
|
OBJECT_MANAGER_CONFIG_MODULE, \
|
||||||
object_config_init \
|
object_config_init \
|
||||||
|
|
Loading…
Reference in New Issue