Skip to content

Commit e25b2a1

Browse files
authored
Merge pull request #568 from david-cermak/bump/wifi_remote_with_eppp
[wifi-remote]: Updated eppp dependency and more WiFi functions
2 parents e011188 + 608b835 commit e25b2a1

File tree

8 files changed

+64
-5
lines changed

8 files changed

+64
-5
lines changed

components/esp_wifi_remote/.cz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ commitizen:
33
bump_message: 'bump(wifi_remote): $current_version -> $new_version'
44
pre_bump_hooks: python ../../ci/changelog.py esp_wifi_remote
55
tag_format: wifi_remote-v$version
6-
version: 0.2.0
6+
version: 0.2.1
77
version_files:
88
- idf_component.yml

components/esp_wifi_remote/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.2.1](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.1)
4+
5+
### Bug Fixes
6+
7+
- Added misc wifi API in eppp impl ([93256d1](https://github.com/espressif/esp-protocols/commit/93256d1))
8+
- Updated eppp dependency not to use fixed version ([3a48c06](https://github.com/espressif/esp-protocols/commit/3a48c06))
9+
310
## [0.2.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.0)
411

512
### Features

components/esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,24 @@ extern "C" esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode)
295295
ESP_RETURN_ON_ERROR(instance.send(api_id::SET_MODE, &mode), TAG, "Failed to send request");
296296
return instance.get_resp<esp_err_t>(api_id::SET_MODE);
297297
}
298+
299+
extern "C" esp_err_t esp_wifi_remote_deinit(void)
300+
{
301+
std::lock_guard<Sync> lock(instance.sync);
302+
ESP_RETURN_ON_ERROR(instance.send(api_id::DEINIT), TAG, "Failed to send request");
303+
return instance.get_resp<esp_err_t>(api_id::DEINIT);
304+
}
305+
306+
extern "C" esp_err_t esp_wifi_remote_disconnect(void)
307+
{
308+
std::lock_guard<Sync> lock(instance.sync);
309+
ESP_RETURN_ON_ERROR(instance.send(api_id::DISCONNECT), TAG, "Failed to send request");
310+
return instance.get_resp<esp_err_t>(api_id::DISCONNECT);
311+
}
312+
313+
extern "C" esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage)
314+
{
315+
std::lock_guard<Sync> lock(instance.sync);
316+
ESP_RETURN_ON_ERROR(instance.send(api_id::SET_STORAGE, &storage), TAG, "Failed to send request");
317+
return instance.get_resp<esp_err_t>(api_id::SET_STORAGE);
318+
}

components/esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ enum class api_id : uint32_t {
1818
ERROR,
1919
UNDEF,
2020
INIT,
21+
DEINIT,
2122
SET_MODE,
2223
SET_CONFIG,
2324
START,
2425
STOP,
2526
CONNECT,
27+
DISCONNECT,
2628
GET_MAC,
29+
SET_STORAGE,
2730
WIFI_EVENT,
2831
IP_EVENT,
2932
};

components/esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,36 @@ class RpcInstance {
164164
}
165165
break;
166166
}
167+
case api_id::DISCONNECT: {
168+
if (header.size != 0) {
169+
return ESP_FAIL;
170+
}
171+
172+
auto ret = esp_wifi_disconnect();
173+
if (rpc.send(api_id::DISCONNECT, &ret) != ESP_OK) {
174+
return ESP_FAIL;
175+
}
176+
break;
177+
}
178+
case api_id::DEINIT: {
179+
if (header.size != 0) {
180+
return ESP_FAIL;
181+
}
182+
183+
auto ret = esp_wifi_deinit();
184+
if (rpc.send(api_id::DEINIT, &ret) != ESP_OK) {
185+
return ESP_FAIL;
186+
}
187+
break;
188+
}
189+
case api_id::SET_STORAGE: {
190+
auto req = rpc.get_payload<wifi_storage_t>(api_id::SET_STORAGE, header);
191+
auto ret = esp_wifi_set_storage(req);
192+
if (rpc.send(api_id::SET_STORAGE, &ret) != ESP_OK) {
193+
return ESP_FAIL;
194+
}
195+
break;
196+
}
167197
case api_id::GET_MAC: {
168198
auto req = rpc.get_payload<wifi_interface_t>(api_id::GET_MAC, header);
169199
esp_wifi_remote_mac_t resp = {};
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dependencies:
2-
espressif/eppp_link: "^0.0.1"
32
esp_wifi_remote:
43
version: "*"
54
override_path: ../../..
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dependencies:
2-
espressif/eppp_link: "^0.0.1"
32
esp_wifi_remote:
43
version: "*"
54
override_path: ../../..

components/esp_wifi_remote/idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
version: 0.2.0
1+
version: 0.2.1
22
url: https://github.com/espressif/esp-protocols/tree/master/components/esp_wifi_remote
33
description: Utility wrapper for esp_wifi functionality on remote targets
44
dependencies:
55
espressif/eppp_link:
6-
version: '0.0.1'
6+
version: '>=0.1'
77
idf:
88
version: '>=5.3'
99
# espressif/esp_hosted:

0 commit comments

Comments
 (0)