From: Caisking Date: Thu, 24 Jul 2025 10:19:06 +0000 (+0800) Subject: 增加运动存储,心率存储服务 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~214^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2006%2F1;p=mirrors%2FFD230.git 增加运动存储,心率存储服务 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/health_service/health_service.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/health_service/health_service.cpp index 86015ee3d..caeb48e75 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/health_service/health_service.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/health/health_service/health_service.cpp @@ -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"); //重新发送该消息 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp index 0e025c297..742bed253 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp @@ -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) { diff --git a/code/sdk/zhihui/utils/custom_fileoperate_service.c b/code/sdk/zhihui/utils/custom_fileoperate_service.c index 3f9953bd0..9362b3473 100644 --- a/code/sdk/zhihui/utils/custom_fileoperate_service.c +++ b/code/sdk/zhihui/utils/custom_fileoperate_service.c @@ -39,18 +39,15 @@ #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){} diff --git a/code/sdk/zhihui/utils/custom_utils.c b/code/sdk/zhihui/utils/custom_utils.c index e15a1424e..56e4891f2 100644 --- a/code/sdk/zhihui/utils/custom_utils.c +++ b/code/sdk/zhihui/utils/custom_utils.c @@ -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){} diff --git a/code/sdk/zhihui/utils/custom_utils_at_cmd.c b/code/sdk/zhihui/utils/custom_utils_at_cmd.c index 7ba55444a..2d33254ba 100644 --- a/code/sdk/zhihui/utils/custom_utils_at_cmd.c +++ b/code/sdk/zhihui/utils/custom_utils_at_cmd.c @@ -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"