From dfd8310bb59b95cb305a2ef5c61ad0e7023c2725 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 18 Mar 2023 18:56:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=90=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 5 +++ TODO.md | 27 +++++++++++- cmakepc.cmake | 5 +-- dep/zclipp | 2 +- dep/zlinuxcomponents | 2 +- src/test_aiui_service.cpp | 108 ---------------------------------------------- 6 files changed, 35 insertions(+), 114 deletions(-) delete mode 100644 src/test_aiui_service.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 62d5b30..1979d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,3 +109,8 @@ zadd_executable_simple(TARGET test_asr_main.out SRC zadd_executable_simple( TARGET test_smart_soundbox_player.out SRC dep/zlinuxcomponents/alsaplayer/test_smart_soundbox_player.cpp) + +zadd_executable_simple( + TARGET test_H8922S_gps_info_reader.out SRC + src/test/test_H8922S_gps_info_reader.cpp + src/service/H8922S_gps_Info_reader.cpp) diff --git a/TODO.md b/TODO.md index e5671da..aebb00b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,2 +1,27 @@ 1. 整理aiui测试代码中的appid,使用测试项目的appid -2. 将应用程序中的aiui的appid修改成配置 \ No newline at end of file +2. 将应用程序中的aiui的appid修改成配置 + + + +------------------------------------------------------------------- + + +7. 将aiui的配置,设备ID的配置,唤醒词的配置,是否记录语音的配置导出,通过config.hpp进行配置 +8. 使用最新的黑板进行测试 +5. 烧录stm32程序,测试主机和stm32之间的通信 +9. 重构工程的Cmake文件,和iflytool.sh文件 +10. 将AIUI的配置写活,在飞书中添加相关第三方服务使用说明手册和注意事项 +12. 创建一个aiui的项目,专门用于工程中的测试代码使用,并修改其配置,添加注释,写好使用时应该参考的文档。 + +6. 编写内核编译说明,和具体项目的内核编译说明 +1. 打包最终包操作系统,为其增加自动保存网卡的功能,去掉内核中的这个功能。 +2. 编写导出文件系统方案和注意事项。 +3. 实现一份通用的文件系统,而非灯杆项目专用文件系统。 +12. 设备开机时,自动打开 +13. 对当前这个版本的内核写应用使用说明 +14. 设备ID +15. 尝试加入降噪,AGC功能。 + +------------------------------------------------------------------- + + diff --git a/cmakepc.cmake b/cmakepc.cmake index bc58715..20391a9 100644 --- a/cmakepc.cmake +++ b/cmakepc.cmake @@ -56,10 +56,9 @@ set(DEP_LINK_LIBRARIES # curlpp curl ) zadd_executable_simple(TARGET test_aiui_service.out SRC - src/test_aiui_service.cpp) + dep/zlinuxcomponents/aiui_ws/test_aiui_service.cpp) zadd_executable_simple( TARGET test_H8922S_gps_info_reader.out SRC src/test/test_H8922S_gps_info_reader.cpp - src/service/H8922S_gps_Info_reader.cpp - ) + src/service/H8922S_gps_Info_reader.cpp) diff --git a/dep/zclipp b/dep/zclipp index 2c32b2f..ccc2ef8 160000 --- a/dep/zclipp +++ b/dep/zclipp @@ -1 +1 @@ -Subproject commit 2c32b2f1f7cc530b1ec1f62c92f698643bb368db +Subproject commit ccc2ef839b360b703e5febba8a6ab29c882d0818 diff --git a/dep/zlinuxcomponents b/dep/zlinuxcomponents index c1eac4f..938de99 160000 --- a/dep/zlinuxcomponents +++ b/dep/zlinuxcomponents @@ -1 +1 @@ -Subproject commit c1eac4f961ff27d8cc4c3f1ddfa985be40750e9d +Subproject commit 938de9936e25f18ce7e07906dfc1bb9937ad231f diff --git a/src/test_aiui_service.cpp b/src/test_aiui_service.cpp deleted file mode 100644 index 96da3c1..0000000 --- a/src/test_aiui_service.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "zlinuxcomponents/zmainhelper.hpp" -// -#include "configs/zconfig.hpp" -#include "iflytopcpp/core/spdlogfactory/logger.hpp" -#include "iflytopcpp/core/thread/thread.hpp" -#include "spdlog/spdlog.h" -#include "version.hpp" -#include "zlinuxcomponents/rootfs_auto_update/rootfs_auto_update.hpp" -#include "zservice_container/zservice_container.hpp" -// -#include "service/device_io_service.hpp" -#include "service/device_io_service_mock.hpp" -#include "service/light_control_service.hpp" -#include "service/report_service.hpp" -#include "zlinuxcomponents/aiui_ws/aiui_service.hpp" - -// -#include "zlinuxcomponents/alsaplayer/AudioPlayerAlsaImpl.hpp" -// #include "zlinuxcomponents/audio/audio_recoder.hpp" -#include - -#include -#include - -#include "zlinuxcomponents/aiui_ws/aiui.h" - -// -using namespace iflytop; -using namespace core; -using namespace std; -using namespace clipp; - -ZMAIN(); -void Main::onSIGINT() { exit(0); } -int Main::main(int argc, char *argv[]) { - string g_host_server_ip; - string g_device_id; - spdlog::flush_on(spdlog::level::debug); - - const char *appid = "5938b7c7"; // 应用ID,在AIUI开放平台创建并设置 - const char *key = "19c1f7becc78eedc7826b485aabe30de"; // 接口密钥,在AIUI开放平台查看 - const char *param = - "{\"result_level\":\"plain\",\"auth_id\":\"ac30105366ea460f9ff08ddac0c4f71e\",\"data_" - "type\":\"text\"," - "\"scene\":\"main_box\",\"sample_rate\":\"16000\", " - "\"context\":\"{\\\"sdk_support\\\":[\\\"nlp\\\",\\\"tts\\\"]}\"}"; - - json paramj; - paramj["result_level"] = "plain"; - paramj["auth_id"] = "ac30105366ea460f9ff08ddac0c4f71e"; - paramj["data_type"] = "text"; - paramj["scene"] = "main_box"; - paramj["sample_rate"] = "16000"; - paramj["context"] = R"({"sdk_support":["nlp","tts","vad","iat"]})"; - // logger->info("{}", paramj.dump()); - // logger->info("{}", param); - - shared_ptr aiuiService(new AiuiService()); - logger->info("test_asr_main.cpp"); - aiuiService->initialize(appid, key, paramj.dump()); - aiuiService->aiuiInit(); - aiuiService->onMessage.connect([&](json &rxjson) { - // - string action = rxjson["action"]; - if (action == "started") { - logger->info("rx started:{}", rxjson.dump()); - } - // - else if (action == "result") { - string sub = rxjson["data"]["sub"]; - if (sub == "nlp") { - logger->info("rx nlp:{}", rxjson.dump()); - } else if (sub == "tts") { - logger->info("rx tts:frame {}", rxjson["data"]["json_args"]["frame_id"].get()); - bool isendFrame = false; - string ttsurl; - aiuiService->parseTTSContent(rxjson, isendFrame, ttsurl); - if (isendFrame) { - logger->info("rx tts end,url={}", ttsurl); - } - } else if (sub == "iat") { - logger->info("rx iat:{}", rxjson.dump()); - } else if (sub == "vad") { - logger->info("rx vad:{}", rxjson.dump()); - } else { - logger->info("rx {}:{}", sub, rxjson.dump()); - } - } - // - else if (action == "error") { - logger->info("rx error:{}", rxjson.dump()); - } - // - else if (action == "vad") { - } else { - logger->info("rx unkown:{}", rxjson.dump()); - } - - try { - if (rxjson["data"]["is_finish"].get()) { - logger->info("end tx"); - } - } catch (...) { - } - }); - aiuiService->aiuiWrite("今天天气怎么样", strlen("今天天气怎么样")); - while (true) sleep(1000); -}