查找手机增加打印,方便分析出现查找手机为什么会有失灵的情况 1172/1
authorluozheng <1732036298@qq.com>
Sat, 12 Oct 2024 09:29:33 +0000 (17:29 +0800)
committerluozheng <1732036298@qq.com>
Sat, 12 Oct 2024 09:29:33 +0000 (17:29 +0800)
code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneModel.h
code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneModel.cpp
code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp

index 0418fd1..92cffcc 100644 (file)
@@ -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() {}
index eb54d64..aa6df22 100644 (file)
@@ -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
index 4635d25..d8e920d 100644 (file)
@@ -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();
         }