From: SnickerSun Date: Sat, 2 Mar 2024 18:09:18 +0000 (+0800) Subject: 修复timer发送AT指令,uart不接收问题。 X-Git-Tag: release_V1.2.70_20241020_135402~1274^2~38^2~5 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=4e2a9a46bf34a77db7bcc322fffbd78ecb3f030d;p=mirrors%2FFD230.git 修复timer发送AT指令,uart不接收问题。 --- diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp index 04765f904..ccf20b416 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp @@ -114,7 +114,7 @@ void uapi_cat1_wakeup_cat1(uint8_t wakeup) void uapi_cat1_pre_init(void) { - char *argv[]={"setvolume","100"}; + char *argv[]={"setvolume","90"}; VoiceCallVolteSample(2,(const char**)argv); } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h index 72a97d60f..36efbfec2 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h @@ -17,6 +17,7 @@ void uapi_cat1_start_volte_voice(void); void uapi_cat1_stop_volte_voice(void); void uapi_cat1_remove_audio_vote(void); void uapi_cat1_add_audio_vote(void); +void uapi_cat1_wakeup_cat1(uint8_t wakeup); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 484f4ad07..0bea9ecf5 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -146,9 +146,13 @@ static void udp_send_response(char *tx_buffer, char *head, char *content) printf("Error occured unkown send data\n"); } } - +#include "uart_porting.h" void udp_send_msg_toCat1(char cmd,char *content) { + uapi_cat1_wakeup_cat1(1); + + uart_port_register_irq(UART_BUS_0); + char station_tx_buffer[256] = {0}; char station_head[2] = {0}; if( sourceAddr.sin_port != 0 ) { @@ -156,6 +160,7 @@ void udp_send_msg_toCat1(char cmd,char *content) station_head[1] = cmd; udp_send_response(station_tx_buffer, station_head, content); } + uapi_cat1_wakeup_cat1(0); } @@ -185,7 +190,9 @@ void cat1_getsignal(void) } void cat1_gettime(void) { + printf("UDP_CMD_GET_TIME\n"); udp_send_msg_toCat1(UDP_CMD_GET_TIME,"0"); + } void cat1_getver(void) { @@ -255,6 +262,7 @@ int cat1_handle_timesync(struct tcp_msg_t *msg) static void time_sync_func(void) { + printf("time_sync_func\n"); cat1_gettime(); if(osTimerIsRunning(g_timer_time_sync)==1 && g_time_synced == 1 ) @@ -273,7 +281,7 @@ void restart_time_sync(void) if(osTimerIsRunning(g_timer_time_sync)==0 ) { WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 restart_time_sync timer \n"); - osTimerStart(g_timer_time_sync,20000); //20秒后重试同步时间 + osTimerStart(g_timer_time_sync,5000); //20秒后重试同步时间 } } @@ -451,8 +459,10 @@ errcode_t cat1_server_init(void) g_timer_time_sync = osTimerNew((osTimerFunc_t)time_sync_func, osTimerPeriodic, NULL, NULL); - restart_time_sync(); - + if (g_timer_time_sync != NULL) + restart_time_sync(); + else + printf("g_timer_time_sync create failed\n"); return ERRCODE_SUCC; } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0107.zip b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip similarity index 99% rename from code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0107.zip rename to code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip index 79ffb4932..f22b277fe 100644 Binary files a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0107.zip and b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip differ diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py index 23912192e..bef0625e7 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py +++ b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py @@ -167,8 +167,8 @@ class Cat1Service: __head = 'FC' self.__message = str(incomming_numb) self.__Socket_UDP(__head, self.__message) - if self.__err == 1 or self.__value[2] != 'OK': - return -1 + # if self.__err == 1 or self.__value[2] != 'OK': + # return -1 return 0 # 电话接听消息 @@ -177,8 +177,8 @@ class Cat1Service: __head = 'FA' self.__message = '0' self.__Socket_UDP(__head, self.__message) - if self.__err == 1 or self.__value[2] != 'OK': - return -1 + # if self.__err == 1 or self.__value[2] != 'OK': + # return -1 return 0 # 电话拒接消息 @@ -187,8 +187,8 @@ class Cat1Service: __head = 'FB' self.__message = '0' self.__Socket_UDP(__head, self.__message) - if self.__err == 1 or self.__value[2] != 'OK': - return -1 + # if self.__err == 1 or self.__value[2] != 'OK': + # return -1 return 0 @@ -198,8 +198,6 @@ class Cat1Service: self.clear_remain() self.__message = str(_timesync) self.__Socket_UDP('FD', self.__message) - if self.__err == 1 or self.__value[2] != 'OK': - return -1 return 0 # 查询网卡版本信息 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index dac39dae6..a7acc5496 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -266,15 +266,13 @@ errcode_t uapi_set_time_from_cat1(char* cat1time) time(&rawtime); timeinfo = localtime(&rawtime); - printf("%04d-%02d-%02d %02d:%02d:%02d %d\n", + printf("set time success %04d-%02d-%02d %02d:%02d:%02d %d\n", timeinfo->tm_year + 1900, timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec,zone); - - printf("set time success %s !\n",cat1time); }else{ printf("convert to time failed ret %d!\n",ret);