void ble_set_ai_Answer_str_(char *buf, uint8_t type)
{
- chat_filter_result_chars(buf);
+ // chat_filter_result_chars(buf);
OHOS::AiVoiceModel::GetInstance().SetAiAnswerStrStr(std::string(buf), type);
}
+ void ble_app_reply_(bool data)
+ {
+ bool state = data;
+ SendMsgToUIService(UI_AI_JUMP_TO_LISTENING_VIEW, 0, &state, sizeof(bool));
+ }
+
extern bleInstruct_t_ bleInstruct_t;
void ble_AI_init(void)
bleInstruct_t.ble_set_ai_Question_str = ble_set_ai_Question_str_;
bleInstruct_t.ble_set_ai_Answer_str = ble_set_ai_Answer_str_;
+
+ bleInstruct_t.ble_app_reply = ble_app_reply_;
+ }
+
+ static void ws_chat_filter_cb_wrapper(char *result)
+ {
+ /* 复用现有过滤实现,忽略返回长度 */
+ chat_filter_result_chars(result);
+ }
+
+ void net4g_AI_init(void)
+ {
+ ws_register_chat_filter_callback(ws_chat_filter_cb_wrapper);
+ ws_register_ai_question_callback(ble_set_ai_Question_str_);
+ ws_register_ai_answer_callback(ble_set_ai_Answer_str_);
}
#endif