From f135bb8966d8a398e5e187019486383f1230ab5f Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Thu, 21 Nov 2024 18:14:07 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E7=9D=A1=E7=9C=A0=E6=95=B0?= =?utf8?q?=E6=8D=AE=E9=87=8D=E5=90=AF=E4=B8=A2=E5=A4=B1bug=EF=BC=8C?= =?utf8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A7=E6=B5=8B=E5=BD=95=E9=9F=B3=E6=B5=8B?= =?utf8?q?=E8=AF=95=E9=9F=B3=E9=87=8F=EF=BC=8C=E4=BC=98=E5=8C=96gsensor?= =?utf8?q?=E7=AE=97=E6=B3=95=E6=97=B6=E9=97=B4=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/AlarmClockTimerConfig.cpp | 6 ++++-- .../nativeui/producttest/src/testmicrophone.cpp | 2 ++ .../include/notify/findwatch_notification.h | 6 ++++-- .../msg_center/src/notify/findwatch_notification.cpp | 11 +++++++++-- code/sdk/drivers/peripheral/cywee/src/main_dml.c | 10 +++++----- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 66b90050d..1f644defa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -497,8 +497,8 @@ extern "C" AlarmEventPublish(TOPIC_EVENT_SLEEPNOTE, NULL, 0); } } - if ((curTime->tm_hour == wake_time_hour && curTime->tm_min == wake_time_min + 1 && curTime->tm_sec == 0) || - (curTime->tm_hour == sleep_time_hour && curTime->tm_min == sleep_time_min + 1 && curTime->tm_sec == 0)) + if ((curTime->tm_hour == wake_time_hour && curTime->tm_min == wake_time_min && curTime->tm_sec == 0) || + (curTime->tm_hour == sleep_time_hour && curTime->tm_min == sleep_time_min && curTime->tm_sec == 0) && curTime->tm_min) { uapi_cywee_time_sync(); } @@ -526,6 +526,7 @@ extern "C" uapi_dev_runtime_set_absolute_static_status(0); // 清零绝对静止状态 set_keep_in_wear_det_mode(1); // 开启小睡佩戴监测 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_NAP_SEDENTARY_MODE, NULL); // 算法底层切换小睡监测模式 + time_sync_flag = 0; } } // 进入睡眠检测模式并退出小睡检测模式 @@ -557,6 +558,7 @@ extern "C" } do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SLEEPING_MODE, NULL); // 算法底层切换睡眠监测模式 + time_sync_flag = 0; } } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp index 346dd1c1c..58fd5951b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp @@ -192,6 +192,7 @@ namespace OHOS else if(makphone_falg==2) { button->SetText("stop play"); + FindWatchViewEventListener::GetInstance().setVolumeVal(100); FindWatchViewEventListener::GetInstance().PopInterPlayMusic(Path); makphone_falg = 3; } @@ -373,6 +374,7 @@ extern "C" if(isopen) { // AlarmClockModel::GetInstance()->testPlayerStart("/user/userdata/microphone.mp3"); + FindWatchViewEventListener::GetInstance().setVolumeVal(100); FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/user/userdata/microphone.mp3"); // AlarmClockModel::GetInstance()->AlarmPlayerStart(); } diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h index ba29c7d07..7bc6632e6 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h @@ -1,8 +1,8 @@ /* * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-25 17:31:19 - * @LastEditors: SnickerSun snickersun@163.com - * @LastEditTime: 2024-10-21 11:49:04 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-11-20 20:50:00 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/include/notify/findwatch_notification.h */ #ifndef FIND_WATCH_NOTIFICATION_H @@ -88,6 +88,8 @@ namespace OHOS const char *GetPath(); + void setVolumeVal(int val); + private: FindWatchViewEventListener(); ~FindWatchViewEventListener(); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp index 927b6d6c2..3baa2e149 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp @@ -1,8 +1,8 @@ /* * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-25 17:33:47 - * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-18 19:32:15 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-11-20 21:06:21 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。 * 以下是基本的实现步骤: @@ -264,6 +264,13 @@ namespace OHOS playerCtr->EnableSingleLooping(true); // 设置是否循环播放 return OHOS_SUCCESS; } + + void FindWatchViewEventListener::setVolumeVal(int val) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "volume:%d", AudioManager::GetInstance().GetVolume(AUDIO_STREAM_NOTIFICATION_SYSTEM)); + AudioManager::GetInstance().SetVolume(AUDIO_STREAM_NOTIFICATION_SYSTEM,val); + } + /* * @brief 停止查找手表铃声 */ diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index bea215a58..4cba1a04f 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -112,7 +112,6 @@ static char time_file_path[64] = {0}; static char status_file_path[64] = {0}; static char nap_file_path[64] = {0}; -static char day[12] = {0}; static char dir_path[64] = {0}; static uint8_t ephemeral_flag = 0; //临时数据 @@ -150,7 +149,8 @@ void get_sleep_file_day(char *day) if (current_min >= sleep_min && current_min < 24 * 60) uapi_get_YYMMDD_Time_extend(day, '\0', -1); - else if (current_min >= 0 && current_min < wake_min) + // else if (current_min >= 0 && current_min < wake_min) + else if (current_min >= 0 && current_min < sleep_min) uapi_get_YYMMDD_Time_extend(day, '\0', 0); } else @@ -185,7 +185,6 @@ void clean_sleep_data(void) memset(&sleep_stat,0,SLEEP_STATUS_LENGTH * sizeof(SLEEP_STAT_T)); memset(time_file_path, 0, sizeof(time_file_path)); memset(status_file_path, 0, sizeof(status_file_path)); - memset(day, 0, sizeof(day)); memset(dir_path, 0, sizeof(dir_path)); memset(nap_file_path, 0, sizeof(nap_file_path)); } @@ -254,8 +253,8 @@ void cywee_save_sleep_time_data(cywee_inactivity_accumulate_time_t sleep_time) { // if (access(time_file_path, 0) == -1) { + char day[12] = {0}; memset(time_file_path, 0, sizeof(time_file_path)); - memset(day, 0, sizeof(day)); get_sleep_file_day(day); sprintf_s(time_file_path, 64, SLEEP_TIME_PATH, day); } @@ -339,7 +338,7 @@ void cywee_save_sleep_time_data(cywee_inactivity_accumulate_time_t sleep_time) void cywee_save_sleep_stat_data(void) { memset(status_file_path, 0, sizeof(status_file_path)); - memset(day, 0, sizeof(day)); + char day[12] = {0}; get_sleep_file_day(day); sprintf_s(status_file_path, 64, SLEEP_STATUS_PATH, day); if (access(status_file_path, 0) == -1) // 文件不存在 直接写入 @@ -815,6 +814,7 @@ void cywee_time_sync(void) CWM_SettingControl(SCL_DATE_TIME, &scl); //时间同步以后创建文件夹 + char day[12] = {0}; get_sleep_file_day(day); sprintf_s(dir_path, 64, SLEEP_DIR_PATH, day); uapi_create_folder(dir_path); -- 2.17.1