修改设置用户数据协议
authorhcj <1224667075@qq.com>
Thu, 17 Oct 2024 08:45:15 +0000 (16:45 +0800)
committerhcj <1224667075@qq.com>
Thu, 17 Oct 2024 08:45:15 +0000 (16:45 +0800)
code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h

index 8e9adfc..3bb082a 100644 (file)
@@ -339,9 +339,9 @@ extern "C"
     {\r
         AlarmClockEventData unuse;\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "on_time_CallBackProc invoked");\r
-\r
-        GraphicService::GetInstance()->PostGraphicEvent(\r
-            std::bind(AlarmTimerEventPublish, TOPIC_EVENT_ON_TIME, unuse));\r
+        AlarmTimerEventPublish(TOPIC_EVENT_ON_TIME, unuse);\r
+        // GraphicService::GetInstance()->PostGraphicEvent(\r
+        //     std::bind(AlarmTimerEventPublish, TOPIC_EVENT_ON_TIME, unuse));\r
 \r
         // AlarmTimerEventPublish(TOPIC_EVENT_ON_TIME, unuse);\r
     }\r
index ad1b20f..02935e1 100644 (file)
@@ -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);
index 5ba9920..b36d32b 100644 (file)
@@ -3486,11 +3486,7 @@ void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_
     \r
 \r
     printf("getUserInfo ");\r
-    // for(uint8_t i = 0;i<len;i++)\r
-    // {\r
-    //     printf("%x ",data[i]);\r
-    // }\r
-    // printf("\n");\r
+\r
     if(Check_CRC(data,len,crcvalue))\r
     {\r
         ble_reply_cmd(USER_INFOR_CMD,1);\r
@@ -3506,6 +3502,8 @@ void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_
         msg_userinfo.target_step = p_userinfo->target_step;\r
         msg_userinfo.timeformat = p_userinfo->timeformat;\r
         msg_userinfo.weight = p_userinfo->weight;\r
+        msg_userinfo.calorie=p_userinfo->calorie;\r
+        msg_userinfo.distance=p_userinfo->distance;\r
 \r
         printf("getUserInfo:!!age %d, fat %d, sex %d, height %d, stand %d, step %d , timeformat %d , weight %d !!!!!!\r\n",\r
         p_userinfo->age,\r
index 12066d9..00184e4 100644 (file)
@@ -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;//获取用户信息 身高体重