Skip to content

Commit

Permalink
Merge pull request espressif#568 from david-cermak/bump/wifi_remote_w…
Browse files Browse the repository at this point in the history
…ith_eppp

[wifi-remote]: Updated eppp dependency and more WiFi functions
  • Loading branch information
david-cermak authored May 7, 2024
2 parents e011188 + 608b835 commit e25b2a1
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/esp_wifi_remote/.cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions components/esp_wifi_remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 21 additions & 0 deletions components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<esp_err_t>(api_id::SET_MODE);
}

extern "C" esp_err_t esp_wifi_remote_deinit(void)
{
std::lock_guard<Sync> lock(instance.sync);
ESP_RETURN_ON_ERROR(instance.send(api_id::DEINIT), TAG, "Failed to send request");
return instance.get_resp<esp_err_t>(api_id::DEINIT);
}

extern "C" esp_err_t esp_wifi_remote_disconnect(void)
{
std::lock_guard<Sync> lock(instance.sync);
ESP_RETURN_ON_ERROR(instance.send(api_id::DISCONNECT), TAG, "Failed to send request");
return instance.get_resp<esp_err_t>(api_id::DISCONNECT);
}

extern "C" esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage)
{
std::lock_guard<Sync> lock(instance.sync);
ESP_RETURN_ON_ERROR(instance.send(api_id::SET_STORAGE, &storage), TAG, "Failed to send request");
return instance.get_resp<esp_err_t>(api_id::SET_STORAGE);
}
3 changes: 3 additions & 0 deletions components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
30 changes: 30 additions & 0 deletions components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<wifi_storage_t>(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<wifi_interface_t>(api_id::GET_MAC, header);
esp_wifi_remote_mac_t resp = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dependencies:
espressif/eppp_link: "^0.0.1"
esp_wifi_remote:
version: "*"
override_path: ../../..
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dependencies:
espressif/eppp_link: "^0.0.1"
esp_wifi_remote:
version: "*"
override_path: ../../..
4 changes: 2 additions & 2 deletions components/esp_wifi_remote/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit e25b2a1

Please sign in to comment.