From: penglei <1624952103@qq.com> Date: Thu, 30 May 2024 12:33:30 +0000 (+0800) Subject: 添加获取cywee chipinfo蓝牙产测指令 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=refs%2Fchanges%2F210%2Ftarget%2F1;p=mirrors%2FFD230.git 添加获取cywee chipinfo蓝牙产测指令 --- diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index f13de9001..32bdddaef 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -23,7 +23,6 @@ #include "mag_service.h" #include "nandflash_config.h" #include "string.h" -#include "custom_utils.h" #include "custom_runtime.h" #include "bletest.h" #pragma pack(1) @@ -1009,8 +1008,18 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 0x06, &send_data, 1); - } + } else if(testitem == 0x07) + { + //获取cywee chipinfo + char chipinfo[64] = {0}; + uapi_cywee_get_chipinfo(chipinfo,sizeof(chipinfo)); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ACC, + 0x07, + (uint8_t *)chipinfo, + strlen(chipinfo)); + } break; case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS: diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index e55d199a6..5d7c2a0d7 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -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() diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index ab21c9ad5..a03e7f53b 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -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; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 3727f727e..822e32f48 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -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) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index c5ae6a7e0..2098b2f02 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -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"