增加运动存储,心率存储服务 2006/1 2006/head 2014/target/1
authorCaisking <Casiking@zhihuishixun.com>
Thu, 24 Jul 2025 10:19:06 +0000 (18:19 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Thu, 24 Jul 2025 10:19:06 +0000 (18:19 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/health/health_service/health_service.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp
code/sdk/zhihui/utils/custom_fileoperate_service.c
code/sdk/zhihui/utils/custom_utils.c
code/sdk/zhihui/utils/custom_utils_at_cmd.c

index 86015ee..caeb48e 100644 (file)
@@ -16,7 +16,7 @@
 #include "custom_runtime.h"
 #include "custom_utils.h"
 
-// #include "safemodemanager/include/SafeModeManagerModelC.h"
+#include "safemodemanager/include/SafeModeManagerModelC.h"
 
 namespace OHOS {
 extern "C" {
@@ -48,7 +48,7 @@ void save_blood_oxygen_data() {
   if (uapi_dev_runtime_get_bloodoxygen_storage_status()) {
     // printf("save_blood_oxygen_data is reading\n");
     //进行延迟
-    LOS_Msleep(100);
+    // LOS_Msleep(100);
     if (uapi_dev_runtime_get_bloodoxygen_storage_status()) {
       // printf("save_blood_oxygen_data is reading again\n");
       //重新发送该消息
@@ -70,7 +70,7 @@ void save_heart_rate_data() {
   if (uapi_dev_runtime_get_heartrate_storage_status()) {
     // printf("save_heart_rate_data is reading\n");
     //进行延迟
-    LOS_Msleep(100);
+    // LOS_Msleep(100);
     if (uapi_dev_runtime_get_heartrate_storage_status()) {
       // printf("save_heart_rate_data is reading again\n");
       //重新发送该消息
index 0e025c2..742bed2 100644 (file)
@@ -9,7 +9,7 @@
 #include "cmsis_os.h"
 #include "custom_utils.h"
 
-// #include "safemodemanager/include/SafeModeManagerModelC.h"
+#include "safemodemanager/include/SafeModeManagerModelC.h"
 
 #include "thread_adapter.h"
 #include "traing/training_card/include/TraingCardPresenter.h"
@@ -205,7 +205,7 @@ static void Training_Notify(void *args, const Topic topic, Request *request) {
 #endif
 
 void store_sport_data() {
-  // printf("运动数据存储!\r\n");
+  printf("运动数据存储!\r\n");
   OHOS::TraingModel::GetInstance()->RecordSportData();
   return;
 }
@@ -514,7 +514,7 @@ void TraingModel::AnalysisData(act_result_t *cyweeInfo) {
     return;
 
   // 不同的运动类型解析不同的数据
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+  WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
                 "AnalysisData:[steps %d, distance %d,calories %d, pace %d, "
                 "step_frequency %d, step_length %d]",
                 cyweeInfo->steps, cyweeInfo->distance, cyweeInfo->calories,
@@ -587,7 +587,7 @@ void TraingModel::AnalysisExtraData(act_ext_result_t *cyweeInfo) {
     return;
   }
 
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[apc:%d fpc:%d cdc:%d std:%d]",
+  WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[apc:%d fpc:%d cdc:%d std:%d]",
                 cyweeInfo->avg_pace, cyweeInfo->max_pace,
                 cyweeInfo->avg_step_freq, cyweeInfo->avg_step_len);
   //平均配速
@@ -796,6 +796,8 @@ void TraingModel::SetTimestamp() {
     do_custom_fileoperate_service_check_msg(
         CUSTOM_FILEOPERATE_MSG_TYPE_SPORTDATA_SAVE, nullptr, 0);
 
+    // store_sport_data();
+
     Startstate = false;
     Endstate = true;
 
@@ -804,19 +806,16 @@ void TraingModel::SetTimestamp() {
       sportTag_ = 0;
       sportTagType_ = ExerciseTag::UNKNOW;
 #endif
+#ifdef BLE_SERVER_ENABLE
     /*运动结束并且是手表发起的运动*/
     if (Openingway == false) {
-#ifdef BLE_SERVER_ENABLE
       sendtraningstateend();
-#endif
     }
     /*运动结束并且是app发起的运动*/
     else {
-#ifdef BLE_SERVER_ENABLE
       sendtraningstatedata(0, sportdata->duration);
-#endif
     }
-
+#endif
     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "结束运动");
   }
 }
@@ -1634,10 +1633,8 @@ bool TraingModel::SavePaceTable() {
 
   WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "paceCount = %d", paceCount);
 
-  std::string filePath =
-      TRAINING_PACE_FILE + std::to_string(sportdata->starttime) + ".bin";
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SavePaceTable filePath: %s",
-                filePath.c_str());
+  std::string filePath = TRAINING_PACE_FILE + std::to_string(sportdata->starttime) + ".bin";
+  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SavePaceTable filePath: %s", filePath.c_str());
 
   std::ofstream paceFile(filePath, std::ios::binary);
   if (!paceFile) {
index 3f9953b..9362b34 100644 (file)
 #include "safemodemanager/include/SafeModeManagerModelC.h"
 #include "sleep/include/SleepModelC.h"
 #include "player/include/PlayersModelC.h"
-#include "system/include/SystemLogModelC.h"
-
 #else
+#include "system/include/SystemLogModelC.h"
 #ifdef __cplusplus
 extern "C"
 {
 #endif
-
 #ifdef FACTORYTEST_SERVICE
 #include "factorytest_protocol.h"
 #endif
-
 #ifdef SUPPORT_CYWEE_SERVICE
 #include "cywee_data.h"
 #endif
@@ -58,13 +55,7 @@ extern "C"
 
 //进行修复开始
 void repair_file_start(void){}
-//进行运动存储
-void store_sport_data(void){}
-//进行心率存储
-// void save_heart_rate_data(void){}
-//进行血氧存储
-// void save_blood_oxygen_data(void){}
-//进行心率列表存储
+
 void custom_save_sleep_data(void){}
 void custom_save_nap_data(void){}
 //void custom_read_sleep_data(void){}
index e15a142..56e4891 100644 (file)
@@ -34,7 +34,7 @@
 #ifdef SUPPORT_TCPIP
 #include "lwip/tcpip.h"
 #endif
-
+#include "system/include/SystemLogModelC.h"
 #ifdef FD230_COMPONENT
 #include "soundandvibration/include/SoundAndVibrationVolumeSettingC.h"
 #include "networkandcall/include/NetworkAndCallC.h"
@@ -43,7 +43,6 @@
 #include "producttest/include/testTPC.h"
 #include "system/include/SystemPresenterC.h"
 #include "producttest/include/testPresenterC.h"
-#include "system/include/SystemLogModelC.h"
 #include "ConfigModelC.h"
 #else
 // void ble_SOS_data_init(void){}
index 7ba5544..2d33254 100644 (file)
@@ -15,9 +15,8 @@
 #endif
 // #include "message_notification.h"
 // #include "MessageModel.h"
-
-#ifdef FD230_650
 #include "system/include/SystemLogModelC.h"
+#ifdef FD230_650
 #include "PhoneServiceC.h"
 
 #include "battery_hal.h"