添加获取cywee chipinfo蓝牙产测指令 205/1 205/head 210/target/1
authorpenglei <1624952103@qq.com>
Thu, 30 May 2024 12:33:30 +0000 (20:33 +0800)
committerpenglei <1624952103@qq.com>
Thu, 30 May 2024 12:33:30 +0000 (20:33 +0800)
code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c
code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h
code/sdk/drivers/peripheral/cywee/src/main_dml.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index f13de90..32bddda 100644 (file)
@@ -23,7 +23,6 @@
 #include "mag_service.h"\r
 #include "nandflash_config.h"\r
 #include "string.h"\r
-#include "custom_utils.h"\r
 #include "custom_runtime.h"\r
 #include "bletest.h"\r
 #pragma pack(1)\r
@@ -1009,8 +1008,18 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                             0x06,\r
                             &send_data,\r
                             1);\r
-            }\r
+            } else if(testitem == 0x07)\r
+            {\r
+                //获取cywee chipinfo\r
+                char chipinfo[64] = {0};\r
+                uapi_cywee_get_chipinfo(chipinfo,sizeof(chipinfo));\r
 \r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ACC,\r
+                            0x07,\r
+                            (uint8_t *)chipinfo,\r
+                            strlen(chipinfo));\r
+            }\r
             break;\r
 \r
         case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS:\r
index e55d199..5d7c2a0 100644 (file)
@@ -507,6 +507,7 @@ void cywee_hand_updown_switch(int cmd);
 void cywee_ar_alert_switch(int cmd);
 void cywee_save_data(void);
 void step_history_save(void);
+void cywee_get_chipinfo(char *databuf,uint8_t len);
 extern uint8_t hrs_mode_state;
 
 #pragma pack()
index ab21c9a..a03e7f5 100644 (file)
@@ -46,13 +46,19 @@ static int stepcount = 0;
 
 int history_step_=0;//存一个小时前的步数数据,每次保存步数时会更新改数据
 
+static char chipInfo[64] = {0};
+
 int cm__hs1__init(void);
 int cm__hs1__deinit(void);
 
+void cywee_get_chipinfo(char *databuf,uint8_t len)
+{
+    memcpy_s(databuf,len,chipInfo,strlen(chipInfo));
+}
+
 void cywee_save_data(void)
 {
     CWM_OS_saveData(&stepcount,sizeof(int));
-
 }
 
 void step_history_save(void)
@@ -68,7 +74,6 @@ void cywee_ar_alert_switch(int cmd)
     CWM_SettingControl(SCL_AR_ALERT_CONFIG, &scl);
 }
 
-
 void cywee_hand_updown_switch(int cmd)
 {
     if(cmd == 1)
@@ -779,8 +784,6 @@ int cywee_main_dml(void)
 #endif
     //get chip information
 
-    char chipInfo[64];
-
     memset(&scl, 0, sizeof(scl));
     scl.iData[0] = 1;
     scl.iData[1] = 1;
index 3727f72..822e32f 100644 (file)
@@ -1855,6 +1855,11 @@ void uapi_cywee_get_id(void)
     PRINT("cywee id : 0x%X \r\n",id);
 }
 
+void uapi_cywee_get_chipinfo(char *databuf,uint8_t len)
+{
+    cywee_get_chipinfo(databuf,len);
+}
+
 #ifdef SUPPORT_ALIPAY_SEC
 #include "alipay_feature.h"
 int custom_exit_lpm(void)
index c5ae6a7..2098b2f 100644 (file)
@@ -177,7 +177,7 @@ int custom_exit_lpm(void);
 void uapi_cywee_get_sleep_data(void);
 void uapi_cywee_set_user_info(int user_info[5]);
 void uapi_cywee_time_sync(void);
-
+void uapi_cywee_get_chipinfo(char *databuf,uint8_t len);
 
 #include "custom_utilscpp.h"