From d1d4278f0470251e5a1b73bf4a38bd78d18cac70 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Thu, 14 Nov 2024 15:31:01 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E7=9B=AE=E6=A0=87=E6=95=B0?= =?utf8?q?=E6=8D=AE=E8=AE=BE=E7=BD=AE=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/blemoder/bletest.cpp | 12 ++++++++--- .../service/ble_service/bleservice/bleEvent.c | 20 ++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 0513d5a0d..5cac1cf86 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1963,13 +1963,19 @@ void set_user_data(msg_user_info_t *data) //目标站立 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标站立 %d\r\n",data->target_stand); + if(data->target_stand) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES,data->target_stand); //目标燃脂 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); + if(data->fat_time) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION,data->fat_time); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); + if(data->calorie) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,data->calorie); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); + if(data->distance) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE,data->distance); do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SET_USER_INFO, NULL); 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 71ab13542..444ffe56a 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -1219,7 +1219,8 @@ void sendBindInfor(uint8_t *data) CustomEventPublish(TOPIC_EVENT_DEVICE_BIND,buf,2); } - }else{ + } + else{ uint8_t buf[2]; memset(buf,0,2); buf[0] = DEVICEBIND; @@ -1719,10 +1720,13 @@ static void SetOtherTarget(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota uint8_t ring = data[5];//铃声 uint8_t vibratior = data[6];//振动 uint8_t notify = data[7];//通知 - + if(target_km) set_goal_discount(target_km); + if(target_stand) set_goal_standupcount(target_stand); + if(target_fattime) set_goal_durationcount(target_fattime); + if(target_kcal) set_goal_caloriescount(target_kcal); // set_SilentMode(ring); @@ -3565,9 +3569,9 @@ void query_dial_installed(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *dat void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue)// { - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"getUserInfo "); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"getUserInfo "); if(Check_CRC(data,len,crcvalue)) { @@ -3577,10 +3581,10 @@ void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_ msg_user_info_t msg_userinfo = {0}; msg_userinfo.age = p_userinfo->age; - msg_userinfo.fat_time = p_userinfo->fat_time; + msg_userinfo.fat_time = p_userinfo->fat_time; msg_userinfo.gender = p_userinfo->gender; msg_userinfo.height = p_userinfo->height; - msg_userinfo.target_stand = p_userinfo->target_stand; + msg_userinfo.target_stand = p_userinfo->target_stand; msg_userinfo.target_step = p_userinfo->target_step; msg_userinfo.timeformat = p_userinfo->timeformat; msg_userinfo.weight = p_userinfo->weight; @@ -7552,9 +7556,11 @@ void decode_file_checksum_2AE6(ble_read_data *buffer_handle) switch(buffer_handle->file_recv_stat.file_type) { case 1: //ota + ble_reply_cmd(FILE_SUCC_TRANSFER,1); + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_STARTOTA,NULL,0); - ble_reply_cmd(FILE_SUCC_TRANSFER,1); + TRANSMIT_DATA=TRANS_OTA_SUCC; CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); -- 2.17.1