From dedd186a0f60bf7d8e607cb38f280eb182e63bbf Mon Sep 17 00:00:00 2001 From: MistEO Date: Sat, 23 Jul 2022 00:18:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AFuuid=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=B9=B6=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/CALLBACK_SCHEMA.md | 2 +- docs/回调消息协议.md | 2 +- src/Java/Maaj/Readme.md | 2 +- src/MeoAssistant/Assistant.cpp | 4 +++- src/MeoAssistant/Controller.cpp | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/en/CALLBACK_SCHEMA.md b/docs/en/CALLBACK_SCHEMA.md index d173e6adaa..fd24fc9977 100644 --- a/docs/en/CALLBACK_SCHEMA.md +++ b/docs/en/CALLBACK_SCHEMA.md @@ -75,7 +75,7 @@ Todo Connection failed. - `Connected` Connected. Note that the `uuid` field is empty now (and will be retrieved in the next step) -- `UuidGetted` +- `UuidGot` UUID has been retrieved. - `UnsupportedResolution` The resolution is not supported. diff --git a/docs/回调消息协议.md b/docs/回调消息协议.md index 5391c4106a..5c630833df 100644 --- a/docs/回调消息协议.md +++ b/docs/回调消息协议.md @@ -75,7 +75,7 @@ Todo 连接失败 - `Connected` 已连接,注意此时的 `uuid` 字段值为空(下一步才是获取) -- `UuidGetted` +- `UuidGot` 已获取到设备唯一码 - `UnsupportedResolution` 分辨率不被支持 diff --git a/src/Java/Maaj/Readme.md b/src/Java/Maaj/Readme.md index 76601f388b..0117c06453 100644 --- a/src/Java/Maaj/Readme.md +++ b/src/Java/Maaj/Readme.md @@ -567,7 +567,7 @@ appendTask setTaskParams start stop等接口不再描述,均可遵循以上规 "width": 1280, "height": 720 }, - "what": "ResolutionGetted", + "what": "ResolutionGot", "why": "" } }, diff --git a/src/MeoAssistant/Assistant.cpp b/src/MeoAssistant/Assistant.cpp index b29f5c6ec5..40dcea766b 100644 --- a/src/MeoAssistant/Assistant.cpp +++ b/src/MeoAssistant/Assistant.cpp @@ -295,7 +295,9 @@ void Assistant::task_callback(AsstMsg msg, const json::value& detail, void* cust { auto p_this = static_cast(custom_arg); json::value more_detail = detail; - more_detail["uuid"] = p_this->m_uuid; + if (!more_detail.contains("uuid")) { + more_detail["uuid"] = p_this->m_uuid; + } switch (msg) { case AsstMsg::InternalError: diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index 4358c31b4a..3701fe5b4c 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -1001,7 +1001,7 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a json::value info = get_info_json() | json::object{ - { "what", "UuidGetted" }, + { "what", "UuidGot" }, { "why", "" } }; info["details"]["uuid"] = m_uuid; @@ -1061,7 +1061,7 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a json::value info = get_info_json() | json::object{ - { "what", "ResolutionGetted" }, + { "what", "ResolutionGot" }, { "why", "" } };