From eda65fd30399249fddbd35bdc21e5ddd842e5f85 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Thu, 19 Dec 2024 14:20:34 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0cat1=E8=BF=90=E8=A1=8C?= =?utf8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/bleservice/bleEvent.c | 9 +++++++-- .../service/ble_service/bleservice/bleEvent.h | 1 + .../peripheral/slip/cat1Service/cat1_server.cpp | 17 ++++++++++++++++- .../peripheral/utils/custom_save_runtime.h | 16 ++++++++++++++-- .../peripheral/utils/custom_utils_at_cmd.c | 7 ++++++- 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 509c19bda..fcb9f97ca 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -464,8 +464,8 @@ void send_big_data(ble_data_type type,char *data, uint16 datalen) } else { - sendDataNow(buf, 17 + datalen + 1); // 判断是否在传输或接收多包数据 -} + sendDataNow(buf, 17 + datalen + 1); // 判断是否在传输或接收多包数据 + } @@ -612,6 +612,11 @@ void inquire_AI_is_ready(uint8_t type) //send_big_data(0, (char *)&type, 1, 1, 1, 1, 0x06, 5); } +void watch_synchronization_time(void) +{ + ble_data_type type_={0x05,0x02,0,1,1}; + send_big_data(type_,NULL,0); +} diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h index 800b1ca9c..63ec74783 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -846,6 +846,7 @@ void watch_clean_pairs(void); void reply_APP_OpenSportModeCmd(bool falg); +void watch_synchronization_time(void); ///////////////////////////自定义文件传输协议///////////////////////////// #define OTA_FILE_MSG_CMD 0x0601 diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 6d9a86d8c..ed1fd6810 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -50,6 +50,7 @@ extern "C" { #include "tcxo.h" #include "custom_utils.h" #include "cmsis_os.h" +#include "custom_save_runtime.h" static uint8_t g_skip_cat1_service_udp_transfer = 0; @@ -1365,17 +1366,22 @@ static int udp_packet_parse(char *rx_buffer, int len) udp_send_msg_toCat1(UDP_MSG_WATCH_REPLY_ACK,"0"); - switch (cmd) { + switch (cmd) { case UDP_MSG_COMMING_CALL: if (get_volte_switch() == false) //如果VOLTE开关没有开启则不接CAT1的来电功能 break; + index = cat1_handle_call_incomming(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_COMMING); break; case UDP_CMD_GET_RECV_NETWORKSTAT: + index = cat1_handle_networ_msg(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_NETWORKSTAT); break; case UDP_CMD_GET_TIME: index = cat1_handle_timesync(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_TIME); break; case UDP_MSG_CALL_CONNECTED: if(g_timer_time_answer) @@ -1385,12 +1391,15 @@ static int udp_packet_parse(char *rx_buffer, int len) osTimerStop(g_timer_time_Dial); index = cat1_handle_call_connected(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_CONNECTED); break; case UDP_MSG_CALL_DISCONNECTED: index = cat1_handle_call_disconnected(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_DISCONNECTED); break; case UDP_CMD_CAT1_OTA_UPDATE: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"CAT1_OTA_UPDATE reply %s\n",msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_OTA_UPDATE); break; case UDP_MSG_REPLY: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"UDP_MSG_REPLY reply %s!!!!!!!\n",msg_buffer); @@ -1457,15 +1466,18 @@ static int udp_packet_parse(char *rx_buffer, int len) osTimerStop(g_timer_time_Dial); } + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_REPLY); break; case UDP_MSG_GET_TELECON_DMP_TIMESEC://暂时不用 break; case UDP_MSG_SEND_DMP_CM_ADDRESS://#接收移动入库CAT1下发的地址 BLE需要保存 set_dmp_cm_address_toCat1(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_DMP_CM_ADDRESS); break; case UDP_CMD_GET_CAT1VER: index = cat1_handle_version_msg(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_GET_CAT1VER); break; case UDP_CMD_MSG_ATCMD: memset_s(ble_buffer,20,0,20); @@ -1476,15 +1488,18 @@ static int udp_packet_parse(char *rx_buffer, int len) }else{ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"ATCMD reply len(%d): %s\n", strlen(msg_buffer),msg_buffer); } + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_ATCMD); break; case UDP_MSG_SAVE_SIM_ICCID://暂时不用 break; case UDP_MSG_RECV_DMP_FACTORY: + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_RECV_DMP); set_dmp_china_mobile_factory_flag(msg_buffer); break; case UDP_MSG_RECV_CAT1_SMS_CONTENT://接收单条短信内容 case UDP_MSG_SMS: index = cat1_handle_sms(msg_buffer); + uapi_save_runtime_log(RUNTIME_LOG_CAT1_UDP_MSG_SMS); break; default: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"error message: %s\n", rx_buffer); diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index 4e5464d82..94b018b28 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -76,11 +76,23 @@ typedef enum { RUNTIME_LOG_PHONE_CAT1_ACTIVE, RUNTIME_LOG_PHONE_CAT1_FINISH, RUNTIME_LOG_PHONE_CAT1_REJECT, - RUNTIME_LOG_PHONE_RESET, //状态复位 - + //cat1 RUNTIME_LOG_CAT1_MIN=0x0300, + RUNTIME_LOG_CAT1_UDP_MSG_COMMING, + RUNTIME_LOG_CAT1_UDP_MSG_NETWORKSTAT, + RUNTIME_LOG_CAT1_UDP_MSG_TIME, + RUNTIME_LOG_CAT1_UDP_MSG_CONNECTED, + RUNTIME_LOG_CAT1_UDP_MSG_DISCONNECTED, + RUNTIME_LOG_CAT1_UDP_MSG_OTA_UPDATE, + RUNTIME_LOG_CAT1_UDP_MSG_REPLY, + RUNTIME_LOG_CAT1_UDP_MSG_DMP_CM_ADDRESS, + RUNTIME_LOG_CAT1_UDP_GET_CAT1VER, + RUNTIME_LOG_CAT1_UDP_MSG_ATCMD, + RUNTIME_LOG_CAT1_UDP_MSG_RECV_DMP, + RUNTIME_LOG_CAT1_UDP_MSG_SMS, + //运动 RUNTIME_LOG_SPORT_MIN=0x0400, //心率 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c index 248d17c1f..cdf4af5b7 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -1155,7 +1155,7 @@ static uint32_t BLE_TEST(uint8_t *para, uint32_t paraLen, char *strCommonCmd) case 16: ble_test_ANCS_notify(type_2); break; - case 17: + case 17: CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&type_2,1); break; case 18: @@ -1167,6 +1167,11 @@ static uint32_t BLE_TEST(uint8_t *para, uint32_t paraLen, char *strCommonCmd) case 20: uapi_save_runtime_log(0x0001); break; + case 21: + watch_synchronization_time(); + break; + + default: break; -- 2.17.1