|
|
|
@ -27,6 +27,7 @@
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
#include "common.h"
|
|
|
|
|
extern int csg_reconn_times;
|
|
|
|
|
extern int mqtt_reconn_times;
|
|
|
|
|
|
|
|
|
|
/* Private define ------------------------------------------------------------*/
|
|
|
|
|
int _network_chat(int fd, const char *at, const char *expect, int timeout, char **response, bool IsPrintf)
|
|
|
|
@ -175,11 +176,6 @@ int _network_AT_read_operation(const char *Devname, const char *cmd, \
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _network_set_connect_type(e_connetType type)
|
|
|
|
|
{
|
|
|
|
|
network_ctrl.connetType = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int _network_change_apn(const char *apn)
|
|
|
|
|
{
|
|
|
|
|
int i=0,num;
|
|
|
|
@ -260,22 +256,6 @@ void _network_kill_ppp()
|
|
|
|
|
system(cmd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _network_check_change()
|
|
|
|
|
{
|
|
|
|
|
if (network_ctrl.connetType == network_ctrl.last_connect_type)
|
|
|
|
|
{
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (network_ctrl.connetType == CONNET4G)
|
|
|
|
|
{
|
|
|
|
|
network_ctrl.net_dev_stat = PPP_OFF;
|
|
|
|
|
}
|
|
|
|
|
network_ctrl.last_connect_type = network_ctrl.connetType;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int _network_check_usb_exist(const char* iDevPath)
|
|
|
|
|
{
|
|
|
|
|
int iReturnCode = 0;
|
|
|
|
@ -474,9 +454,19 @@ void *_network_manage_thread(void *args)
|
|
|
|
|
// found ppp0
|
|
|
|
|
ppp_not_found_cnt = 0;
|
|
|
|
|
// The connection still fails in the presence of ppp0 and needs to be restarted
|
|
|
|
|
if (pparam_config->gateway.CommunicationMode == 2)
|
|
|
|
|
{
|
|
|
|
|
if (mqtt_reconn_times > 6)
|
|
|
|
|
{
|
|
|
|
|
reboot_system(LOG_NETWORK, BOOT_PPP_FOUND_MQTT_LINK_FAIL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (csg_reconn_times > 10)
|
|
|
|
|
{
|
|
|
|
|
reboot_system(LOG_NETWORK, BOOT_PPP_FOUND_LINK_FAIL);
|
|
|
|
|
reboot_system(LOG_NETWORK, BOOT_PPP_FOUND_CSG_LINK_FAIL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|