* @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
{
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() {}
* @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
*/
}
// 开始或停止查找手机
- 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
* @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"
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();
}