Merge branch 'sdk650pathc0423' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0... 2802/1
authorxue <2144439972@qq.com>
Wed, 26 Nov 2025 02:23:25 +0000 (10:23 +0800)
committerxue <2144439972@qq.com>
Wed, 26 Nov 2025 02:23:25 +0000 (10:23 +0800)
1  2 
code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api.h
code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c
code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp
code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.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;
  
@@@ -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},
      {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<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
@@@ -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;
  
@@@ -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
  };
@@@ -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