Skip to content

Commit 3c40bfc

Browse files
authored
Merge pull request #47 from david-cermak/feat/custom_impl
Support for custom WiFi remote implementation
2 parents 77deec1 + bd14565 commit 3c40bfc

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
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.13.0
6+
version: 0.14.0
77
version_files:
88
- idf_component.yml

components/esp_wifi_remote/CHANGELOG.md

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

3+
## [0.14.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.14.0)
4+
5+
### Features
6+
7+
- Add support for custom wifi-remote impl ([9bf662f](https://github.com/espressif/esp-wifi-remote/commit/9bf662f))
8+
39
## [0.13.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.13.0)
410

511
### Features

components/esp_wifi_remote/CMakeLists.txt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ endif()
99
idf_component_register(INCLUDE_DIRS include
1010
SRCS ${src_wifi_is_remote}
1111
${src_wifi_remote_eppp}
12+
dummy_src.c # Prevents making this component potentially INTERFACE only
1213
PRIV_INCLUDE_DIRS eppp
1314
REQUIRES esp_event esp_netif
1415
PRIV_REQUIRES esp_wifi esp-tls vfs)
@@ -27,8 +28,6 @@ endif()
2728

2829
idf_component_get_property(wifi esp_wifi COMPONENT_LIB)
2930

30-
set(TARGET_INCLUDE_TYPE "INTERFACE")
31-
set(TARGET_SOURCE_TYPE "INTERFACE")
3231
if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
3332
set(src_wifi_with_remote ${IDF_VER_DIR}/esp_wifi_with_remote.c)
3433
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
@@ -37,25 +36,21 @@ if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
3736
# We need to build wifi sources with wifi-remote properties, so the injected wifi headers are used
3837
get_target_property(wifi_sources ${wifi} SOURCES)
3938
set_target_properties(${wifi} PROPERTIES SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dummy_src.c")
40-
set(TARGET_INCLUDE_TYPE "PUBLIC")
41-
set(TARGET_SOURCE_TYPE "PRIVATE")
4239
endif()
4340

44-
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP)
45-
set(TARGET_INCLUDE_TYPE "PUBLIC")
46-
set(TARGET_SOURCE_TYPE "PRIVATE")
47-
else()
41+
# Add weak symbol for the wifi_remote API if we're using esp_hosted implementation
42+
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED)
4843
set(src_wifi_remote_weak ${IDF_VER_DIR}/esp_wifi_remote_weak.c)
4944
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
5045
list(APPEND src_wifi_remote_weak ${IDF_VER_DIR}/esp_eap_client_remote_weak.c)
5146
endif()
5247
endif()
5348

5449

55-
target_include_directories(${COMPONENT_LIB} ${TARGET_INCLUDE_TYPE} ${IDF_VER_DIR}/include)
56-
target_sources(${COMPONENT_LIB} ${TARGET_SOURCE_TYPE} ${src_wifi_remote_weak}
57-
${src_wifi_with_remote}
58-
${wifi_sources})
50+
target_include_directories(${COMPONENT_LIB} PUBLIC ${IDF_VER_DIR}/include)
51+
target_sources(${COMPONENT_LIB} PRIVATE ${src_wifi_remote_weak}
52+
${src_wifi_with_remote}
53+
${wifi_sources})
5954

6055
if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
6156
# Update wifi include directories to prepend the injected dir with modified headers supporting SLAVE capability
@@ -67,5 +62,5 @@ endif()
6762
target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB})
6863

6964
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
70-
idf_component_optional_requires(${TARGET_INCLUDE_TYPE} wpa_supplicant)
65+
idf_component_optional_requires(PRIVATE wpa_supplicant)
7166
endif()

components/esp_wifi_remote/Kconfig.rpc.in

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ choice ESP_WIFI_REMOTE_LIBRARY
55
Select type of WiFi Remote implementation
66

77
ESP-HOSTED is the default and most versatile option.
8-
It's also possible to use EPPP, which uses PPPoS link between micros and NAPT, so it's slower
9-
and less universal.
8+
It's possible to use EPPP, which uses PPPoS link between micros and NAPT,
9+
so it's slower, but allows for more customization on the slave side.
10+
It's also possible to select CUSTOM and provide wifi_remote implementation
11+
in any other component or application (needs to set link dependency from wifi-remote
12+
to the custom implementation)
1013

1114
config ESP_WIFI_REMOTE_LIBRARY_HOSTED
1215
bool "ESP-HOSTED"
1316
config ESP_WIFI_REMOTE_LIBRARY_EPPP
1417
bool "EPPP"
18+
config ESP_WIFI_REMOTE_LIBRARY_CUSTOM
19+
bool "CUSTOM"
20+
1521
endchoice
1622

1723
if ESP_WIFI_REMOTE_LIBRARY_EPPP

components/esp_wifi_remote/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.13.0
1+
version: 0.14.0
22
url: https://github.com/espressif/esp-wifi-remote
33
description: Utility wrapper for esp_wifi functionality on remote targets
44
dependencies:

0 commit comments

Comments
 (0)