[lpa]1.添加eg91NAXD的USBnet初始化
This commit is contained in:
parent
3457993928
commit
f477da93e2
|
@ -169,6 +169,41 @@ static SINT16 app_Qlog_procress(void) {
|
|||
return s32ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
void sf_usb_net_init()
|
||||
{
|
||||
static U16 flag = 0;
|
||||
SF_CHAR cmdStr[128] ={0};
|
||||
int ret = 0;
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
|
||||
if(flag == 0)
|
||||
{
|
||||
flag = 1;
|
||||
|
||||
//sprintf(cmdStr, "insmod /appfs/bin/GobiNet.ko");
|
||||
//ret = system(cmdStr);
|
||||
//sleep(3);
|
||||
|
||||
if(strstr(puiPara->Sim4gApn, V_MODULE_APN))
|
||||
{
|
||||
sprintf(cmdStr, "/usr/bin/quectel-CM-EG91 -n %d&", V_PDP_INDEX);
|
||||
}
|
||||
else if(strstr(puiPara->Sim4gApn, A_MODULE_APN))
|
||||
{
|
||||
sprintf(cmdStr, "/usr/bin/quectel-CM-EG91 -n %d&", A_PDP_INDEX);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(cmdStr, "/usr/bin/quectel-CM-EG91 -n %d&", E_PDP_INDEX);
|
||||
}
|
||||
ret = system(cmdStr);
|
||||
sleep(3);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SINT32 sf_USB_net_init(void)
|
||||
{
|
||||
//SF_CHAR cmdStr[128] = {0};
|
||||
|
@ -181,43 +216,49 @@ SINT32 sf_USB_net_init(void)
|
|||
if (flag == 0)
|
||||
{
|
||||
flag = 1;
|
||||
if(AT_MANAGER_SUCCEED != at_usbnet_init())
|
||||
if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0)
|
||||
{
|
||||
MLOGE("usb net err %d\n", AT_MANAGER_SUCCEED);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 20; i++)
|
||||
if(AT_MANAGER_SUCCEED != at_usbnet_init())
|
||||
{
|
||||
if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0)
|
||||
MLOGE("usb net err %d\n", AT_MANAGER_SUCCEED);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sf_usb_net_init();
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0)
|
||||
{
|
||||
ret = sf_check_usb0();
|
||||
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
ret = sf_check_eth0();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
ret = sf_check_eth0();
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
ret = sf_check_usb0();
|
||||
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
ret = sf_check_eth0();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
ret = sf_check_eth0();
|
||||
if(ret != SUCCESS)
|
||||
{
|
||||
ret = sf_check_usb0();
|
||||
}
|
||||
}
|
||||
if (SUCCESS == ret)
|
||||
{
|
||||
ret = SF_SUCCESS;
|
||||
MLOGI("usb net ip up\r\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
if (SUCCESS == ret)
|
||||
{
|
||||
ret = SF_SUCCESS;
|
||||
MLOGI("usb net ip up\r\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue
Block a user