From 2ba5fff7c3696c58ea13ed336dcf5b349ba96c39 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 23 Nov 2024 16:55:33 +0800 Subject: [PATCH] =?utf8?q?cat1=E5=8D=87=E7=BA=A7=E9=99=90=E5=88=B6?= =?utf8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- cat1modem/src/main.py | 3 ++ .../fs/user/system/cat1ota/Cat1pyVersion.txt | 1 + .../slip/cat1Service/cat1_server.cpp | 32 +++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/system/cat1ota/Cat1pyVersion.txt diff --git a/cat1modem/src/main.py b/cat1modem/src/main.py index 0f8b84a69..fa20465a8 100644 --- a/cat1modem/src/main.py +++ b/cat1modem/src/main.py @@ -6,16 +6,19 @@ try: except Exception as e: main_flag = 0 print("启动失败!!!!!\r\n".format(e),'slipservice') + try: from usr.tcpService import TcpService except Exception as e: main_flag = 0 print("启动失败!!!!!\r\n".format(e),'tcpService') + try: import usr.checkota except Exception as e: main_flag = 0 print("启动失败!!!!!\r\n".format(e),'checkota') + example.exec('/usr/main_init.py') print("启动成功!!!!!\r\n") except Exception as e: diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/system/cat1ota/Cat1pyVersion.txt b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/system/cat1ota/Cat1pyVersion.txt new file mode 100644 index 000000000..19c7bdba7 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/system/cat1ota/Cat1pyVersion.txt @@ -0,0 +1 @@ +16 \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 3ed7a45dd..4599a858d 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -247,7 +247,11 @@ static uint8_t g_time_synced = 0; #define MAX_TIME_SYNC_RETRY_TIME 5 static uint8_t g_time_sync_retry_time = 0; -#define PY_SRV_VER_CURRENT 15 + +static uint8_t need_py_srv_ver_txt = 0; + +#define PY_SRV_VER_CURRENT 16 + #define PY_SRV_VER_SUPORT_PY_OTA_MINI_VER 13 @@ -755,7 +759,23 @@ static int decodeNetStat(char* msg) if ( g_python_updated == 0) { /**升级开始,马上设置 */ - if (g_py_ver >= PY_SRV_VER_SUPORT_PY_OTA_MINI_VER && g_py_ver != PY_SRV_VER_CURRENT) + // if(>=16) + // /home/hcj/FD230/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/system/cat1ota/Cat1pyVersion.txt + + FILE *fp= fopen("/user/system/cat1ota/Cat1pyVersion.txt","rb+"); + if(fp) + { + char read_buf[32]={0}; + int read_size=fread(read_buf,1,32,fp); + if(read_size) + { + need_py_srv_ver_txt=atoi(read_buf); + } + fclose(fp); + } + + + if (g_py_ver >= PY_SRV_VER_SUPORT_PY_OTA_MINI_VER && (g_py_ver < PY_SRV_VER_CURRENT ) || g_py_ver=16 - if(g_py_ver>=16) + if(g_py_ver>=16) { if(osTimerIsRunning(g_timer_time_answer)==0 ) { @@ -1352,6 +1372,12 @@ static int udp_packet_parse(char *rx_buffer, int len) index = cat1_handle_timesync(msg_buffer); break; case UDP_MSG_CALL_CONNECTED: + if(g_timer_time_answer) + osTimerStop(g_timer_time_answer); + + if(g_timer_time_Dial) + osTimerStop(g_timer_time_Dial); + index = cat1_handle_call_connected(msg_buffer); break; case UDP_MSG_CALL_DISCONNECTED: -- 2.17.1