From: xue <2144439972@qq.com> Date: Wed, 26 Nov 2025 02:23:25 +0000 (+0800) Subject: Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0... X-Git-Tag: V1.0.9_20251128_194606_LN~12 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=712b23c560e93e18c5c6ee99e77fedc6b0497f8b;p=mirrors%2FFD230.git Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 --- 712b23c560e93e18c5c6ee99e77fedc6b0497f8b diff --cc code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h index 3f94263ea,954055ac0..1a2efcbec --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h @@@ -75,7 -75,7 +75,8 @@@ typedef enum HAND_UPGRADE_DESCRIPTION_NOTIFY, // 升级描述通知 HAND_STORY_RESPONSE_FINISHED_NOTIFY, // 故事响应finished通知 HAND_DIALOGUE_RESPONSE_FINISHED_NOTIFY, // 对话响应finished通知 + HAND_VAD_INITIALIZED_NOTIFY, // VAD初始化完成通知 + HAND_BLUETOOTH_CONNECT_NOTIFY, // 蓝牙耳机连接通知 MAX_NUM_HANDLER, } UiServiceMsgId; diff --cc code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp index bcea95300,968cbb383..21b0569a3 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp @@@ -116,7 -111,8 +116,9 @@@ static void HandTimelineStatusChangeNot static void HandUpgradeDescriptionNotify(Request *request); static void HandStoryResponseFinishedNotify(Request *request); static void HandDialogueResponseFinishedNotify(Request *request); +static void HandVadInitializedNotify(Request *request); + static void HandBluetoothConnectNotify(Request *request); + // 消息处理程序项数组(每个消息类型对应一个处理函数,函数名以 Handle 开头) MsgHandlerEntry msgHandlers[] = { {HANDLE_JUMP_OTA_VIEW, HandleJumpOtaView}, @@@ -144,7 -140,7 +146,8 @@@ {HAND_UPGRADE_DESCRIPTION_NOTIFY,HandUpgradeDescriptionNotify}, {HAND_STORY_RESPONSE_FINISHED_NOTIFY,HandStoryResponseFinishedNotify}, {HAND_DIALOGUE_RESPONSE_FINISHED_NOTIFY,HandDialogueResponseFinishedNotify}, + {HAND_VAD_INITIALIZED_NOTIFY,HandVadInitializedNotify}, + {HAND_BLUETOOTH_CONNECT_NOTIFY,HandBluetoothConnectNotify}, }; /* -------------------------------------------------------------------------- */ void ScreenTurnOn(int32_t timeout) @@@ -823,16 -819,16 +826,26 @@@ void HandDialogueResponseFinishedNotify OHOS::ThunderBirdModel::GetInstance(), finished)); } } + +void HandVadInitializedNotify(Request *request) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandVadInitializedNotify msg_id = %d", request->msgId); + // 隐藏等待语音初始化提醒,并进入对话模式 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind([]() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "VAD initialized, hiding reminder and entering dialogue mode"); + std::bind(&OHOS::ThunderBirdModel::HandleVadInitialized,OHOS::ThunderBirdModel::GetInstance()); + })); + // 通知蓝牙耳机连接操作 + void HandBluetoothConnectNotify(Request *request) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandBluetoothConnectNotify msg_id = %d", request->msgId); + // std::string bluetoothAddress(static_cast(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 diff --cc code/sdk/zhihui/leiniao/imsl_ln/ln_api.h index cb1448c4c,72633fd17..8e7e5553b --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h @@@ -418,8 -442,10 +442,11 @@@ typedef enum WS_CMD_AUDIO_RECORDING_START, /* 开始录音上传 */ WS_CMD_AUDIO_RECORDING_END, /* 结束录音上传 */ WS_CMD_SENTENCE_PLAYBACK_COMPLETE, /* 单句语音播放完成 */ + WS_CMD_VAD_INITIALIZED, /* VAD 服务器初始化完成 */ WS_CMD_DEVICE_UPGRADE, /* 设备升级(DeviceUpgrade) */ + WS_CMD_BLUETOOTH_CONNECT, /* 蓝牙连接(BluetoothConnect) */ + WS_CMD_BLUETOOTH_UNBIND, /* 蓝牙解绑(BluetoothUnbind) */ + WS_CMD_BLUETOOTH_STATUS_REPORT_ACK, /* 蓝牙状态上报应答(BluetoothStatusReportAck) */ WS_CMD_MAX /* 最大命令 */ } ws_command_t; diff --cc code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp index 310a74f20,f084027fc..3089da0d3 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp @@@ -323,12 -323,11 +323,17 @@@ void push_dialogue_response_finished_no WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DIALOGUE_RESPONSE_FINISHED] finished=%d", finished); SendMsgToUIService(HAND_DIALOGUE_RESPONSE_FINISHED_NOTIFY, 0, &finished, sizeof(finished)); } + +//通知VAD初始化完成 +void push_vad_initialized_notification(void) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[VAD_INITIALIZED] VAD server initialized"); + SendMsgToUIService(HAND_VAD_INITIALIZED_NOTIFY, 0, NULL, 0); + //通知进行蓝牙耳机连接操作 + 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 }; diff --cc code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h index 31c485295,0d9330275..5d2314ed7 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h @@@ -117,8 -117,8 +117,10 @@@ void push_upgrade_description_notificat void push_story_response_finished_notification(bool finished); //通知对话响应finished void push_dialogue_response_finished_notification(bool finished); +//通知VAD初始化完成 +void push_vad_initialized_notification(void); + //通知进行蓝牙耳机连接操作 + void push_bluetooth_connect_notification(const char *bluetoothAddress); #ifdef __cplusplus } #endif