增加cat1运行日志记录 1533/1
authorhcj <1224667075@qq.com>
Thu, 19 Dec 2024 06:20:34 +0000 (14:20 +0800)
committerhcj <1224667075@qq.com>
Thu, 19 Dec 2024 06:20:34 +0000 (14:20 +0800)
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp
code/sdk/drivers/peripheral/utils/custom_save_runtime.h
code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c

index 509c19b..fcb9f97 100644 (file)
@@ -464,8 +464,8 @@ void send_big_data(ble_data_type type,char *data, uint16 datalen)
     }\r
     else\r
     {\r
-    sendDataNow(buf, 17 + datalen + 1); // 判断是否在传输或接收多包数据\r
-}\r
+        sendDataNow(buf, 17 + datalen + 1); // 判断是否在传输或接收多包数据\r
+    }\r
    \r
     \r
 \r
@@ -612,6 +612,11 @@ void inquire_AI_is_ready(uint8_t type)
     //send_big_data(0, (char *)&type, 1, 1, 1, 1, 0x06, 5);\r
 }\r
 \r
+void watch_synchronization_time(void)\r
+{\r
+    ble_data_type type_={0x05,0x02,0,1,1};\r
+    send_big_data(type_,NULL,0);\r
+}\r
 \r
 \r
 \r
index 800b1ca..63ec747 100644 (file)
@@ -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 
index 6d9a86d..ed1fd68 100644 (file)
@@ -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);
index 4e5464d..94b018b 100644 (file)
@@ -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,
     //心率
index 248d17c..cdf4af5 100644 (file)
@@ -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;