From 5b59ace186c826e275f6cd4cc8513ddadd645b1f Mon Sep 17 00:00:00 2001 From: wangbo Date: Tue, 9 Jan 2024 09:00:41 +0000 Subject: [PATCH] =?UTF-8?q?ADD=201.=E5=A2=9E=E5=8A=A0=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=8B=A8=E5=8F=B7=E7=AB=AF=E5=8F=A3=E6=97=A5=E5=BF=97?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/include/common.h | 1 + app/lib/a_process/ca_csg.c | 2 +- app/lib/a_process/ca_network.c | 6 +++--- app/lib/m_management/common.c | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/include/common.h b/app/include/common.h index 3e9567f..6bb0b1c 100755 --- a/app/include/common.h +++ b/app/include/common.h @@ -122,6 +122,7 @@ typedef enum _BOOT_MSG BOOT_DAU_ERR_RESET, BOOT_PPP_NO_FOUND, BOOT_PPP_FOUND_LINK_FAIL, + BOOT_TTYUSB_NO_FOUND, BOOT_MAX, } BOOT_MSG; diff --git a/app/lib/a_process/ca_csg.c b/app/lib/a_process/ca_csg.c index 85b1bea..018d4b5 100755 --- a/app/lib/a_process/ca_csg.c +++ b/app/lib/a_process/ca_csg.c @@ -349,7 +349,7 @@ int _csg_response_realtime_data(int sendtype) prtd->StartFlag1 = sysctrl.dev_hex_id; prtd->FarmeType = sendtype; prtd->RunSecCnt = t - sysctrl.start_time; - prtd->Local_Vbat = 6500; + prtd->Local_Vbat = pwr.vbat; prtd->RMS_Ia = cauValues[0]; prtd->RMS_Ib = cauValues[1]; prtd->RMS_Ic = cauValues[2]; diff --git a/app/lib/a_process/ca_network.c b/app/lib/a_process/ca_network.c index afcebc5..f13cddd 100755 --- a/app/lib/a_process/ca_network.c +++ b/app/lib/a_process/ca_network.c @@ -343,8 +343,8 @@ int _network_ppp_check_test(void) FILE *Read_fp; int chars_read; char buffer[1000]; - memset(buffer,0,1000); - memset(cmd,0,100); + memset(buffer,0,sizeof(buffer)); + memset(cmd,0,sizeof(cmd)); sprintf(cmd,"ifconfig | grep ppp0"); Read_fp = popen(cmd,"r"); if(Read_fp != NULL) @@ -487,7 +487,7 @@ void *_network_manage_thread(void *args) if (++reset_cnt >= 6) { reset_cnt = 0; - reboot_system(LOG_NETWORK, BOOT_PPP_NO_FOUND); + reboot_system(LOG_NETWORK, BOOT_TTYUSB_NO_FOUND); } _network_usb_4g_power_on(); diff --git a/app/lib/m_management/common.c b/app/lib/m_management/common.c index 5595b9d..478cfa6 100755 --- a/app/lib/m_management/common.c +++ b/app/lib/m_management/common.c @@ -607,6 +607,7 @@ boot_msg_t g_bootmsg[] = {BOOT_DAU_ERR_RESET, "DAU communicate ERROR."}, {BOOT_PPP_NO_FOUND, "ppp0 not found."}, {BOOT_PPP_FOUND_LINK_FAIL, "ppp0 found but link failed."}, + {BOOT_TTYUSB_NO_FOUND, "/dev/ttyUSB3 not found."}, {BOOT_MAX, NULL} };