static void HandUpgradeDescriptionNotify(Request *request);
static void HandStoryResponseFinishedNotify(Request *request);
static void HandDialogueResponseFinishedNotify(Request *request);
+static void HandBluetoothConnectNotify(Request *request);
+
// 消息处理程序项数组(每个消息类型对应一个处理函数,函数名以 Handle 开头)
MsgHandlerEntry msgHandlers[] = {
{HANDLE_JUMP_OTA_VIEW, HandleJumpOtaView},
{HAND_UPGRADE_DESCRIPTION_NOTIFY,HandUpgradeDescriptionNotify},
{HAND_STORY_RESPONSE_FINISHED_NOTIFY,HandStoryResponseFinishedNotify},
{HAND_DIALOGUE_RESPONSE_FINISHED_NOTIFY,HandDialogueResponseFinishedNotify},
+ {HAND_BLUETOOTH_CONNECT_NOTIFY,HandBluetoothConnectNotify},
};
/* -------------------------------------------------------------------------- */
void ScreenTurnOn(int32_t timeout)
OHOS::ThunderBirdModel::GetInstance(), finished));
}
}
+// 通知蓝牙耳机连接操作
+void HandBluetoothConnectNotify(Request *request)
+{
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandBluetoothConnectNotify msg_id = %d", request->msgId);
+ // std::string bluetoothAddress(static_cast<char*>(request->data), request->len);
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandBluetoothConnectNotify bluetoothAddress = %s", bluetoothAddress.c_str());
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(&OHOS::ThunderBirdModel::HandleBluetoothConnect,
+ OHOS::ThunderBirdModel::GetInstance(), "AA:BB:CC:DD:EE:FF"));//要连接的蓝牙设备MAC地址,保留字段,暂时无用
+
+}
/* -------------------------------------------------------------------------- */
#ifdef __cplusplus
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BT] BluetoothConnect - userId: %s, bluetoothAddress: %s",
g_bluetooth_connect_data.user_id, g_bluetooth_connect_data.bluetooth_address);
+ // 发送蓝牙连接通知
+ push_bluetooth_connect_notification(g_bluetooth_connect_data.bluetooth_address);
+ /* 发送蓝牙连接应答 */
+ ln_ws_send_bluetooth_connect_ack(true, "蓝牙连接中");
+
cJSON_Delete(root);
free(text);
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DIALOGUE_RESPONSE_FINISHED] finished=%d", finished);
SendMsgToUIService(HAND_DIALOGUE_RESPONSE_FINISHED_NOTIFY, 0, &finished, sizeof(finished));
}
+//通知进行蓝牙耳机连接操作
+void push_bluetooth_connect_notification(const char *bluetoothAddress)
+{
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLUETOOTH_CONNECT] bluetoothAddress=%s", bluetoothAddress);
+ SendMsgToUIService(HAND_BLUETOOTH_CONNECT_NOTIFY, 0, (void *)bluetoothAddress, (int32_t)strlen(bluetoothAddress));
+}
#ifdef __cplusplus
};
#endif
\ No newline at end of file