From 3a48c06e969cc93be7b178f67698b6249955b816 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 6 May 2024 16:56:31 +0200 Subject: [PATCH 1/3] fix(wifi_remote): Updated eppp dependency not to use fixed version --- .../esp_wifi_remote/examples/mqtt/main/idf_component.yml | 1 - .../esp_wifi_remote/examples/server/main/idf_component.yml | 1 - components/esp_wifi_remote/idf_component.yml | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/esp_wifi_remote/examples/mqtt/main/idf_component.yml b/components/esp_wifi_remote/examples/mqtt/main/idf_component.yml index 22d411780f..88b71aa807 100644 --- a/components/esp_wifi_remote/examples/mqtt/main/idf_component.yml +++ b/components/esp_wifi_remote/examples/mqtt/main/idf_component.yml @@ -1,5 +1,4 @@ dependencies: - espressif/eppp_link: "^0.0.1" esp_wifi_remote: version: "*" override_path: ../../.. diff --git a/components/esp_wifi_remote/examples/server/main/idf_component.yml b/components/esp_wifi_remote/examples/server/main/idf_component.yml index 22d411780f..88b71aa807 100644 --- a/components/esp_wifi_remote/examples/server/main/idf_component.yml +++ b/components/esp_wifi_remote/examples/server/main/idf_component.yml @@ -1,5 +1,4 @@ dependencies: - espressif/eppp_link: "^0.0.1" esp_wifi_remote: version: "*" override_path: ../../.. diff --git a/components/esp_wifi_remote/idf_component.yml b/components/esp_wifi_remote/idf_component.yml index 8073e5b5ef..ee3843d9f4 100644 --- a/components/esp_wifi_remote/idf_component.yml +++ b/components/esp_wifi_remote/idf_component.yml @@ -1,9 +1,9 @@ -version: 0.2.0 +version: 0.2.1 url: https://github.com/espressif/esp-protocols/tree/master/components/esp_wifi_remote description: Utility wrapper for esp_wifi functionality on remote targets dependencies: espressif/eppp_link: - version: '0.0.1' + version: '>=0.1' idf: version: '>=5.3' # espressif/esp_hosted: From 93256d159b6258d468d452ec9f84ab47821b61bf Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 7 May 2024 15:00:29 +0200 Subject: [PATCH 2/3] fix(wifi_remote): Added misc wifi API in eppp impl Adds missing implementation of: * esp_wifi_deinit() * esp_wifi_disconnect() * esp_wifi_set_storage() --- .../eppp/wifi_remote_rpc_client.cpp | 21 +++++++++++++ .../eppp/wifi_remote_rpc_impl.hpp | 3 ++ .../eppp/wifi_remote_rpc_server.cpp | 30 +++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp b/components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp index c287cc1679..f2de628f8a 100644 --- a/components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp +++ b/components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp @@ -295,3 +295,24 @@ extern "C" esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) ESP_RETURN_ON_ERROR(instance.send(api_id::SET_MODE, &mode), TAG, "Failed to send request"); return instance.get_resp(api_id::SET_MODE); } + +extern "C" esp_err_t esp_wifi_remote_deinit(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::DEINIT), TAG, "Failed to send request"); + return instance.get_resp(api_id::DEINIT); +} + +extern "C" esp_err_t esp_wifi_remote_disconnect(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::DISCONNECT), TAG, "Failed to send request"); + return instance.get_resp(api_id::DISCONNECT); +} + +extern "C" esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::SET_STORAGE, &storage), TAG, "Failed to send request"); + return instance.get_resp(api_id::SET_STORAGE); +} diff --git a/components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp b/components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp index 30a0104db2..2b8d6d2715 100644 --- a/components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp +++ b/components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp @@ -18,12 +18,15 @@ enum class api_id : uint32_t { ERROR, UNDEF, INIT, + DEINIT, SET_MODE, SET_CONFIG, START, STOP, CONNECT, + DISCONNECT, GET_MAC, + SET_STORAGE, WIFI_EVENT, IP_EVENT, }; diff --git a/components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp b/components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp index 0a8645d952..9665e5cc37 100644 --- a/components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp +++ b/components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp @@ -164,6 +164,36 @@ class RpcInstance { } break; } + case api_id::DISCONNECT: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_disconnect(); + if (rpc.send(api_id::DISCONNECT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::DEINIT: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_deinit(); + if (rpc.send(api_id::DEINIT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::SET_STORAGE: { + auto req = rpc.get_payload(api_id::SET_STORAGE, header); + auto ret = esp_wifi_set_storage(req); + if (rpc.send(api_id::SET_STORAGE, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } case api_id::GET_MAC: { auto req = rpc.get_payload(api_id::GET_MAC, header); esp_wifi_remote_mac_t resp = {}; From 608b835680ac76795306ee83192234bfb3f1f3e2 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 7 May 2024 20:06:43 +0200 Subject: [PATCH 3/3] bump(wifi_remote): 0.2.0 -> 0.2.1 0.2.1 Bug Fixes - Added misc wifi API in eppp impl (93256d1) - Updated eppp dependency not to use fixed version (3a48c06) --- components/esp_wifi_remote/.cz.yaml | 2 +- components/esp_wifi_remote/CHANGELOG.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi_remote/.cz.yaml b/components/esp_wifi_remote/.cz.yaml index 4cbf53c2bd..6c3fb702af 100644 --- a/components/esp_wifi_remote/.cz.yaml +++ b/components/esp_wifi_remote/.cz.yaml @@ -3,6 +3,6 @@ commitizen: bump_message: 'bump(wifi_remote): $current_version -> $new_version' pre_bump_hooks: python ../../ci/changelog.py esp_wifi_remote tag_format: wifi_remote-v$version - version: 0.2.0 + version: 0.2.1 version_files: - idf_component.yml diff --git a/components/esp_wifi_remote/CHANGELOG.md b/components/esp_wifi_remote/CHANGELOG.md index 2d49bd1475..76ea35d9a3 100644 --- a/components/esp_wifi_remote/CHANGELOG.md +++ b/components/esp_wifi_remote/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.1](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.1) + +### Bug Fixes + +- Added misc wifi API in eppp impl ([93256d1](https://github.com/espressif/esp-protocols/commit/93256d1)) +- Updated eppp dependency not to use fixed version ([3a48c06](https://github.com/espressif/esp-protocols/commit/3a48c06)) + ## [0.2.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.0) ### Features