#ifdef SUPPORT_CYWEE_SERVICE
#include "cywee_hal.h"
#include "cywee_data.h"
+#include "cywee_service.h"
#endif
#include "cat1_pub_api.h"
std::bind(&OHOS::BloodOxygenModel::CleanAllData,
OHOS::BloodOxygenModel::GetInstance()));
printf("health end\n");
+ /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
+ RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
+
+ // 存储nextday执行日志
+ start_report_nextday_log_end();
+ // 清除popup_windows日志
+ nextday_clear_popup_windows_log();
+
+ printf("******nextday is end******\r\n");
+#endif
+#ifdef SUPPORT_CYWEE_SERVICE
/* --------------------------------- 每日目标相关 --------------------------------- */
cywee_reset_history_daily_data(); //清除运动相关数据
// SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
printf("sport end\n");
- /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
- RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
-
- // 存储nextday执行日志
- start_report_nextday_log_end();
- // 清除popup_windows日志
- nextday_clear_popup_windows_log();
-
- printf("******nextday is end******\r\n");
#endif
#if defined(BOARD_W9)
printf("******nextday is begin******\r\n");
{
unused(req);
AlarmClockEventData* time=(AlarmClockEventData*)req->data;
- #ifdef SUPPORT_CYWEE_SERVICE
+
+#ifdef SUPPORT_CYWEE_SERVICE
cywee_save_data(); //暂时没有这个函数
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据");
if(cywee_get_stand_flag())
- cywee_stand_history_save(time->value);
+ cywee_stand_history_save(time->value);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据");
cywee_calories_history_save(time->value);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时燃脂数据");
cywee_fat_history_save(time->value);
+#endif
// 保存完增加一次读取数据
SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
-#endif
- }
+}
//设备绑定通知
void MsgCenterNotifyDeviceBindProc(const Topic topic, Request* req)
{
#ifdef SUPPORT_CYWEE_SERVICE
#include "cywee_hal.h"
+#include "cywee_data.h"
+#include "cywee_service.h"
#endif
#include "cat1_pub_api.h"
+#include "uiservice/include/ui_service.h"
namespace OHOS {
std::bind(&OHOS::BloodOxygenModel::CleanAllData,
OHOS::BloodOxygenModel::GetInstance()));
printf("health end\n");
+ /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
+ RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
+
+ // 存储nextday执行日志
+ start_report_nextday_log_end();
+ // 清除popup_windows日志
+ nextday_clear_popup_windows_log();
+
+ printf("******nextday is end******\r\n");
+#endif
+#ifdef SUPPORT_CYWEE_SERVICE
/* --------------------------------- 每日目标相关 --------------------------------- */
cywee_reset_history_daily_data(); //清除运动相关数据
// SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
printf("sport end\n");
- /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
- RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
-
- // 存储nextday执行日志
- start_report_nextday_log_end();
- // 清除popup_windows日志
- nextday_clear_popup_windows_log();
-
- printf("******nextday is end******\r\n");
#endif
#if defined(BOARD_W9)
printf("******nextday is begin******\r\n");
{
unused(req);
AlarmClockEventData* time=(AlarmClockEventData*)req->data;
- #ifdef SUPPORT_CYWEE_SERVICE
-#if 0
- cywee_save_data(); //暂时没有这个函数
+#ifdef SUPPORT_CYWEE_SERVICE
+ cywee_save_data();
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时步数");
- step_history_save(time->value);
+ cywee_step_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据");
- if(get_stand_falg())
- stand_history_save(time->value);
+ if(cywee_get_stand_flag())
+ cywee_stand_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据");
- calories_history_save(time->value);
+ cywee_calories_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时距离数据");
- distances_history_save(time->value);
+ cywee_distances_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时燃脂数据");
- fat_history_save(time->value);
+ cywee_fat_history_save(time->value);
+#endif
// 保存完增加一次读取数据
SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
-#endif
- #endif
}
//设备绑定通知
void MsgCenterNotifyDeviceBindProc(const Topic topic, Request* req)
#ifdef SUPPORT_CYWEE_SERVICE
#include "cywee_hal.h"
+#include "cywee_data.h"
+#include "cywee_service.h"
#endif
#include "cat1_pub_api.h"
+#include "uiservice/include/ui_service.h"
namespace OHOS {
std::bind(&OHOS::BloodOxygenModel::CleanAllData,
OHOS::BloodOxygenModel::GetInstance()));
printf("health end\n");
+ /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
+ RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
+
+ // 存储nextday执行日志
+ start_report_nextday_log_end();
+ // 清除popup_windows日志
+ nextday_clear_popup_windows_log();
+
+ printf("******nextday is end******\r\n");
+#endif
+#ifdef SUPPORT_CYWEE_SERVICE
/* --------------------------------- 每日目标相关 --------------------------------- */
cywee_reset_history_daily_data(); //清除运动相关数据
// SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
printf("sport end\n");
- /* ---------------------------------- 呼吸训练相关 ---------------------------------- */
- RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime();
-
- // 存储nextday执行日志
- start_report_nextday_log_end();
- // 清除popup_windows日志
- nextday_clear_popup_windows_log();
-
- printf("******nextday is end******\r\n");
#endif
#if defined(BOARD_W9)
printf("******nextday is begin******\r\n");
{
unused(req);
AlarmClockEventData* time=(AlarmClockEventData*)req->data;
- #ifdef SUPPORT_CYWEE_SERVICE
-#if 0
- cywee_save_data(); //暂时没有这个函数
+#ifdef SUPPORT_CYWEE_SERVICE
+ cywee_save_data();
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时步数");
- step_history_save(time->value);
+ cywee_step_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据");
- if(get_stand_falg())
- stand_history_save(time->value);
+ if(cywee_get_stand_flag())
+ cywee_stand_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据");
- calories_history_save(time->value);
+ cywee_calories_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时距离数据");
- distances_history_save(time->value);
+ cywee_distances_history_save(time->value);
+
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时燃脂数据");
- fat_history_save(time->value);
+ cywee_fat_history_save(time->value);
// 保存完增加一次读取数据
- SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
#endif
- #endif
+ SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
}
//设备绑定通知
void MsgCenterNotifyDeviceBindProc(const Topic topic, Request* req)
* @Author: penglei 1624952103@qq.com
* @Date: 2024-04-08 14:53:31
* @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-09-30 18:03:35
+ * @LastEditTime: 2025-10-09 11:43:54
* @FilePath: /FD230/code/sdk/drivers/peripheral/cywee/service/cywee_dml.c
* @Description:
*
}
int ret =fwrite(data,1,len,fp);
- PRINT("CWM_OS_saveData fwrite failed %d %d\n",ret,*data);
+ PRINT("CWM_OS_saveData fwrite type:%d data:%d ret:%d\n",type,ret,*data);
fclose(fp);
}
}
uapi_dev_runtime_set_goal_storage_status(1);
- int step = cywee_get_sport_data(STEP);
+ int step = cywee_get_sport_data(STEP) + cywee_get_sport_data(HISTORY_STEP);
int calories = cywee_get_sport_data(NEW_CALORIES) + cywee_get_sport_data(HISTORY_CALORIES);
int distances = cywee_get_sport_data(NEW_DISTANCE) + cywee_get_sport_data(HISTORY_DISTANCE);
int fat = cywee_get_sport_data(NEW_FAT) + cywee_get_sport_data(HISTORY_FAT);
float history_calories_ = cywee_get_sport_data(HISTORY_CALORIES_);
// CWM_OS_dbgPrintf("history_calories is saving\n");
CWM_OS_saveData_history(&history_calories,&history_calories_,sizeof(float),CALORIES,time);
+ cywee_set_sport_data(history_calories_,HISTORY_CALORIES_);
}
void cywee_distances_history_save(uint32_t time)
float history_distances_ = cywee_get_sport_data(HISTORY_DISTANCE_);
// CWM_OS_dbgPrintf("history_distances is saving\n");
CWM_OS_saveData_history(&history_distances_now,&history_distances_,sizeof(float),DISTANCE,time);
+ cywee_set_sport_data(history_distances_,HISTORY_DISTANCE_);
}
void cywee_fat_history_save(uint32_t time)
}
int history_fat_ = cywee_get_sport_data(HISTORY_FAT_);
CWM_OS_saveData_history(&temp_data,&history_fat_,sizeof(uint16_t),FAT,time);
+ cywee_set_sport_data(history_fat_,HISTORY_FAT_);
}
int history_step_ = cywee_get_sport_data(HISTORY_STEP_);
// CWM_OS_dbgPrintf("step_history is saving\n");
CWM_OS_saveData_history(&data,&history_step_,sizeof(int),STEP,time);
+ cywee_set_sport_data(history_step_,HISTORY_STEP_);
}
break;
case 0x45://同步站立历史数据
- // if(cywee_get_stand_falg())
+ // if(cywee_get_stand_flag())
// {
// memcpy(buf+size,&creationTime,4);
// size+=4;