diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 2ac9744e5..19d5fab7f 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -87,21 +87,27 @@ SF_THREAD_S QlogTsk = { SINT32 app_ttyusb_IsOpen(void) { int retryTime = 0; int retryFlag = 0; - SINT32 s32ret = 0; + static SINT32 s32ret = SF_SUCCESS; + static int flag = 0; + + if(flag) + { + return s32ret; + } MLOGD("ttyUSB has not been init, will init ttyUSB!\n"); UINT8 i = 0; RETRY: for (i = 0; i < 150; i++) { if (access("/dev/ttyUSB2", F_OK) == SF_SUCCESS) { - printf("tty usb ko exist!\r\n"); + // printf("tty usb ko exist!\r\n"); printf("4G Init OK\r\n"); break; } else { usleep(100 * 1000); if(149 == i) { - MLOGE("NO ttyUSB dev!!\n"); + // MLOGE("NO ttyUSB dev!!\n"); printf("4G Init ERR\r\n"); } } @@ -121,12 +127,13 @@ SINT32 app_ttyusb_IsOpen(void) { } else if ((1 == retryFlag) && (retryTime >= 50) && (retryTime % 50 == 0)) // 200ms*25 = 5s { - MLOGE("-------ttyUSB retry init fail!\n"); + // MLOGE("-------ttyUSB retry init fail!\n"); s32ret = SF_TTY_ERROR_OPEN; printf("4G Init Fail, retry\r\n"); break; } } + flag = 1; MLOGD("e\n"); return s32ret; } @@ -1140,7 +1147,7 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) { if (sf_usb_IsInsert()) return SF_SUCCESS; - SLOGD("STARTUP:[%d]\n", sf_poweron_type_get()); +// SLOGD("STARTUP:[%d]\n", sf_poweron_type_get()); if (sf_get_cq_signal() == 0) { SLOGD("no csq signal\n"); return SF_SUCCESS; @@ -2173,7 +2180,7 @@ int sf_check_eth0(void) // Check if an IP address is assigned if (strstr(output, "inet ") == NULL) { - MLOGI("The network card exists, but no IP address has been assigned\n"); + // MLOGI("The network card exists, but no IP address has been assigned\n"); pclose(fp); free(output); return 1;