Skip to content

Commit c033d07

Browse files
committed
fix(wifi_remote): Per review comments
1 parent 8896d10 commit c033d07

29 files changed

+802
-510
lines changed

.github/workflows/wifi_remote__build.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
${IDF_PATH}/install.sh --enable-pytest
2626
. ${IDF_PATH}/export.sh
2727
cd ./components/esp_wifi_remote/scripts
28-
python parse_header.py
29-
./check_headers.sh
28+
python generate_and_check.py
3029
3130
build_wifi_remote:
3231
if: contains(github.event.pull_request.labels.*.name, 'wifi_remote') || github.event_name == 'push'
@@ -40,6 +39,10 @@ jobs:
4039
steps:
4140
- name: Checkout esp-protocols
4241
uses: actions/checkout@v3
42+
- name: ccache
43+
uses: hendrikmuhs/[email protected]
44+
with:
45+
key: ${{ matrix.idf_ver }}
4346
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
4447
shell: bash
4548
run: |

ci/ignore_astyle.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# The below file is generated from esp_wifi_types_native.h in IDF, which doesn't follow atyle
12
components/esp_wifi_remote/include/esp_wifi_types_native.h

components/esp_wifi_remote/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ if(NOT CONFIG_ESP_WIFI_ENABLED)
33
endif()
44

55
idf_component_register(INCLUDE_DIRS include
6-
SRCS wifi_remote_rpc.c wifi_remote_net.c wifi_remote_init.c ${src_wifi_is_remote}
6+
SRCS wifi_remote_rpc.c wifi_remote_net.c wifi_remote_init.c ${src_wifi_is_remote} esp_wifi_remote_weak.c
77
REQUIRES esp_event esp_netif
88
PRIV_REQUIRES esp_wifi esp_hosted)

components/esp_wifi_remote/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This file is auto-generated
12
menu "Wi-Fi Remote"
23
orsource "./Kconfig.soc_wifi_caps.in"
34

components/esp_wifi_remote/Kconfig.soc_wifi_caps.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ if SLAVE_IDF_TARGET_ESP32C6
199199

200200
config SLAVE_SOC_WIFI_FTM_SUPPORT
201201
bool
202-
default n
202+
default y
203203

204204
config SLAVE_SOC_WIFI_GCMP_SUPPORT
205205
bool

components/esp_wifi_remote/README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
[![Component Registry](https://components.espressif.com/components/espressif/esp_wifi_remote/badge.svg)](https://components.espressif.com/components/espressif/esp_wifi_remote)
44

5+
Purpose of this component is to provide WiFi functionality on ESP chipsets that don't have WiFi. For these chips, you don't need anything but adding a dependency to this component from your project, which will bring WiFi-remote menuconfig and standard `esp_wifi` interface.
6+
7+
It's also possible to use this component on ESP chipsets that so support native WiFi to have one more WiFi interface available using `esp_wifi_remote` interface.
8+
9+
To use the component you also need a slave device (which must support WiFi) connected to your target device in a specific way (defined by a transport layer of esp_hosted).
10+
511
This component wraps the public API of `esp_wifi` and provides a set of the same function calls namespaces with `esp_wifi_remote` prefix that translate to RPC calls to another target device (called `slave` device) which executes the appropriate `esp_wifi` APIs.
612

713
This component is heavily dependent on a specific version of the `esp_wifi` component, as that's why most of its headers, sources and configuration files are pre-generated based on the actual version of `esp_wifi`.
@@ -13,8 +19,8 @@ This component doesn't implement the RPC calls by itself, but uses their depende
1319

1420
Public API needs to correspond exactly to the `esp_wifi` API. Some of the internal types depend on the actual wifi target, as well as some default configuration values. Therefore it's easier to maintain consistency between this component and the exact version of `esp_wifi` automatically in CI:
1521

16-
We extract function prototypes from `esp_wifi.h` and use them to generate `esp_wifi_remote` function declarations (and forwarding the definitions to the underlying RPC component -- `esp_hosted`)
17-
We process the local `esp_wifi_types_native.h` and replace `CONFIG_IDF_TARGET` to `CONFIG_SLAVE_IDF_TARGET` and `CONFIG_SOC_WIFI_...` to `CONFIG_SLAVE_...`.
18-
Similarly we process `esp_wifi`'s Kconfig, so the dependencies are on the slave target and slave SOC capabilities.
22+
* We extract function prototypes from `esp_wifi.h` and use them to generate `esp_wifi_remote` function declarations (and forwarding the definitions to the underlying RPC component -- [`esp_hosted`](https://github.com/espressif/esp-hosted)).
23+
* We process the local `esp_wifi_types_native.h` and replace `CONFIG_IDF_TARGET` to `CONFIG_SLAVE_IDF_TARGET` and `CONFIG_SOC_WIFI_...` to `CONFIG_SLAVE_...`.
24+
* Similarly we process `esp_wifi`'s Kconfig, so the dependencies are on the slave target and slave SOC capabilities.
1925

2026
Please check the [README.md](./scripts/README.md) for more details on the generation step and testing consistency.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#pragma once
7+
#include "esp_wifi.h"
8+
#include "esp_wifi_remote.h"
9+
10+
esp_err_t remote_esp_wifi_init_slave(void);
11+
12+
// handling channels
13+
esp_err_t esp_wifi_remote_channel_rx(void *h, void *buffer, void *buff_to_free, size_t len);
14+
esp_err_t esp_wifi_remote_channel_set(wifi_interface_t ifx, void *h, esp_remote_channel_tx_fn_t tx_cb);
15+
esp_err_t esp_wifi_remote_rpc_channel_rx(void *h, void *buffer, size_t len);
16+
esp_err_t esp_wifi_remote_rpc_channel_set(void *h, esp_remote_channel_tx_fn_t tx_cb);

0 commit comments

Comments
 (0)