From 6f856dfdd5b7730c92d0bb0d3338d14ddf5ddf98 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 12 Oct 2024 17:29:33 +0800 Subject: [PATCH] =?utf8?q?=E6=9F=A5=E6=89=BE=E6=89=8B=E6=9C=BA=E5=A2=9E?= =?utf8?q?=E5=8A=A0=E6=89=93=E5=8D=B0=EF=BC=8C=E6=96=B9=E4=BE=BF=E5=88=86?= =?utf8?q?=E6=9E=90=E5=87=BA=E7=8E=B0=E6=9F=A5=E6=89=BE=E6=89=8B=E6=9C=BA?= =?utf8?q?=E4=B8=BA=E4=BB=80=E4=B9=88=E4=BC=9A=E6=9C=89=E5=A4=B1=E7=81=B5?= =?utf8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/findphone/include/FindPhoneModel.h | 5 +++-- .../fd230app/nativeui/findphone/src/FindPhoneModel.cpp | 9 +++++++-- .../fd230app/nativeui/findphone/src/FindPhoneView.cpp | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h b/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h index 0418fd11d..92cffcc85 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h @@ -2,11 +2,12 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 15:21:17 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-30 11:10:19 + * @LastEditTime: 2024-10-12 17:22:50 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h */ #ifndef FINDPHONE_MODEL_H #define FINDPHONE_MODEL_H +#include "cstdint" namespace OHOS { @@ -16,7 +17,7 @@ namespace OHOS static FindPhoneModel &GetInstance(); void SetBlueToothConnectedState(bool state); bool GetBlueToothConnectedState(); - void start_or_stop_find_phone(int val); + void start_or_stop_find_phone(uint8_t val); private: FindPhoneModel() {} ~FindPhoneModel() {} diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp index eb54d6463..aa6df22ba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 15:21:30 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-30 11:11:00 + * @LastEditTime: 2024-10-12 17:18:27 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp */ @@ -39,12 +39,17 @@ namespace OHOS } // 开始或停止查找手机 - void FindPhoneModel::start_or_stop_find_phone(int val) + void FindPhoneModel::start_or_stop_find_phone(uint8_t val) { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "start_or_stop_find_phone %d", val); // 发送指令停止震动 if (FindPhoneModel::GetInstance().GetBlueToothConnectedState()) { senfindphoneSend(val); } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "start_or_stop_find_phone not connected"); + } } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp index 4635d256c..d8e920deb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp @@ -8,7 +8,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 10:47:46 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-05 10:16:43 + * @LastEditTime: 2024-10-12 17:13:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp */ #include "findphone/include/FindPhoneView.h" @@ -283,11 +283,13 @@ namespace OHOS if (FindPhoneModel::GetInstance().GetBlueToothConnectedState() == true) // 判断蓝牙是否是连接状态 { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phone is connected"); FindPhoneViewInit_BlueToothConnected(); FindPhoneModel::GetInstance().start_or_stop_find_phone(FINDPHONE_START); } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phone is not connected"); FindPhoneViewInit_BlueToothDisConnected(); } -- 2.17.1