From: hcj <1224667075@qq.com> Date: Thu, 25 Jul 2024 03:58:38 +0000 (+0800) Subject: 修复起床设置时间异常BUG X-Git-Tag: release_V1.2.70_20241020_135402~702^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9efa32db343c15cb267bd1ce813cfc9b6a91a5ca;p=mirrors%2FFD230.git 修复起床设置时间异常BUG --- 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 e23cafa14..7cd15332d 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -36,7 +36,7 @@ #include "AlarmClockManage.h" #include "SetDialModel.h" - +//#include "AlarmClockModel.h" #include "AiVoiceModel.h" #include "SleepModel.h" //#include "AlarmClockModel.h" @@ -782,11 +782,13 @@ void ble_set_sleep_remind(msg_get_sleep_param_info_t data) { printf("开始时间:%d\r\n",data.bedtime_hour); printf("开始时间:%d\r\n",data.bedtime_min); - p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_BEDTIME,data.bedtime_hour<<16|data.bedtime_min); + + p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_BEDTIME,hour<<16|data.bedtime_min); printf("结束时间:%d\r\n",data.waketime_hour); printf("结束时间:%d\r\n",data.waketime_min); - p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_GET_UP,data.waketime_hour<<16|data.waketime_min); + + p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_GET_UP,hour<<16|data.waketime_min); printf("睡前提醒 %d\r\n",data.bedtime_alarm); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_REMIND,data.bedtime_alarm); @@ -913,18 +915,23 @@ void ble_SetAlarmInfo(uint32_t time_hour, uint32_t time_min, uint8_t week,uint8_ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::SetAlarmInfo copy alarmname error!"); return; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::NewAlarmTime clock name = %s, id = %u", + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::NewAlarmTime clock name = %s, id = %u", eventAlarmInfo.alarmClockName, eventAlarmInfo.alarmClockId); if ( id+1 >= AlmmgrGetEventAlarmCnt()) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::SetAlarmWeek new time!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::SetAlarmWeek new time!"); int ret = AlmmgrAddAlarmClock(&eventAlarmInfo); } else { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::SetAlarmWeek modify time!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::SetAlarmWeek modify time!"); AlmmgrUpdataAlarmClock(&eventAlarmInfo); } } +void ble_AlarmClock_refresh(void) +{ + //OHOS::AlarmClockModel::GetInstance()->InitAlarmData(); +} + char * struct_to_json_buf_malloc_Alarm(void) { diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index 0269a5b3e..4d0bbffb5 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -182,10 +182,10 @@ int get_goal_standupcount(void);//获取目标站立次数 char* struct_to_json_buf_malloc_(uint8_t day); char * struct_to_json_buf_malloc_Alarm(void); - - +////////////////闹钟相关///////////////////////////// void ble_SetAlarmInfo(uint32_t time_hour, uint32_t time_min, uint8_t week,uint8_t id,uint8_t enable); +void ble_AlarmClock_refresh(void); void ble_delet_all_AlarmInfo(void); @@ -317,7 +317,7 @@ uint8_t ble_get_oxygen_data(void); cJSON* ble_get_recs_data(void); -////////////////////消息//////////////////////////// +////////////////////消息/////////////////////////////////// void ble_add_message_index(uint32_t old_index); uint32_t ble_get_message_index(void); 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 c97a4a6e9..abd584dcf 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -499,11 +499,11 @@ typedef struct //对应数据的指令类型 uint8_t schedule;//Schedule setting 作息时间设定 - uint8_t bedtime_hour;///就寝时间小时0-23 - uint8_t bedtime_min;//就寝时间分钟0-59 + uint32_t bedtime_hour;///就寝时间小时0-23 + uint32_t bedtime_min;//就寝时间分钟0-59 - uint8_t waketime_hour;//起床时间小时0-23 - uint8_t waketime_min;//起床时间分钟0-59 + uint32_t waketime_hour;//起床时间小时0-23 + uint32_t waketime_min;//起床时间分钟0-59 uint8_t bedtime_alarm;//就寝前20分钟提醒开关 0关闭 1开启 }msg_get_sleep_param_info_t;//app获取睡眠设置 @@ -518,6 +518,16 @@ typedef struct // uint8_t filecount;//文件个数 }msg_recv_dial_info_t;//表盘资源展示说明 +typedef struct +{ + uint16_t dial_uid;//dial UID + uint8_t battery;//电池 + uint8_t time;//时间 + uint8_t time_font; //时间字体 + +}msg_recv_custom_dial_info_t; + + typedef struct { uint16_t dial_uid;//dial UID @@ -786,6 +796,12 @@ void GetCurDataCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,ui bool get_ctkd_flag(void); +///////////////////////////自定义文件传输协议///////////////////////////// +#define OTA_FILE_MSG_CMD 0x0601 +#define OTA_FILE_DATA_CMD 0x0602 +#define OTA_FILE_SUCC_CMD 0x0603 +#define OTA_FILE_FAIL_CMD 0x0604 + #ifdef __cplusplus } #endif