From: luozheng <1732036298@qq.com> Date: Sat, 12 Oct 2024 09:29:33 +0000 (+0800) Subject: 查找手机增加打印,方便分析出现查找手机为什么会有失灵的情况 X-Git-Tag: release_V1.2.70_20241020_135402~64 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6f856dfdd5b7730c92d0bb0d3338d14ddf5ddf98;p=mirrors%2FFD230.git 查找手机增加打印,方便分析出现查找手机为什么会有失灵的情况 --- 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(); }