From 77dbde3950271c0e4e4a1677da3f5433aec9a6db Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Thu, 17 Oct 2024 16:45:15 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE=E7=94=A8?= =?utf8?q?=E6=88=B7=E6=95=B0=E6=8D=AE=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp | 6 +++--- .../wearable/service/ble_service/blemoder/bletest.cpp | 6 ++++++ .../wearable/service/ble_service/bleservice/bleEvent.c | 8 +++----- .../wearable/service/ble_service/bleservice/bleEvent.h | 3 +++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 8e9adfc5f..3bb082aa0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -339,9 +339,9 @@ extern "C" { AlarmClockEventData unuse; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "on_time_CallBackProc invoked"); - - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(AlarmTimerEventPublish, TOPIC_EVENT_ON_TIME, unuse)); + AlarmTimerEventPublish(TOPIC_EVENT_ON_TIME, unuse); + // GraphicService::GetInstance()->PostGraphicEvent( + // std::bind(AlarmTimerEventPublish, TOPIC_EVENT_ON_TIME, unuse)); // AlarmTimerEventPublish(TOPIC_EVENT_ON_TIME, unuse); } 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 ad1b20fd7..02935e1c1 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1887,6 +1887,10 @@ void set_user_data(msg_user_info_t *data) //目标燃脂 printf("目标燃脂 %d\r\n",data->fat_time); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION,data->fat_time); + printf("目标卡路里 %d\r\n",data->fat_time); + p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,data->calorie); + printf("目标距离 %d\r\n",data->fat_time); + 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); if(data->timeformat==0) @@ -1894,6 +1898,8 @@ void set_user_data(msg_user_info_t *data) else p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_24HOUR,12); + + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); 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 5ba992094..b36d32b93 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -3486,11 +3486,7 @@ void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_ printf("getUserInfo "); - // for(uint8_t i = 0;itarget_step; msg_userinfo.timeformat = p_userinfo->timeformat; msg_userinfo.weight = p_userinfo->weight; + msg_userinfo.calorie=p_userinfo->calorie; + msg_userinfo.distance=p_userinfo->distance; printf("getUserInfo:!!age %d, fat %d, sex %d, height %d, stand %d, step %d , timeformat %d , weight %d !!!!!!\r\n", p_userinfo->age, 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 12066d9b0..00184e474 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -674,6 +674,9 @@ typedef struct uint16_t fat_time;//燃脂时间目标 uint8_t target_stand;//目标站立 uint8_t timeformat;//时间制 0 24小时制 1 12小时制 + + uint16_t calorie;//目标卡路里 + uint8_t distance;//目标距离 }msg_user_info_t;//获取用户信息 身高体重 -- 2.17.1