Skip to content

Commit

Permalink
Merge pull request #516 from david-cermak/feat/wifi_remote
Browse files Browse the repository at this point in the history
New component `esp_wifi_remote`
  • Loading branch information
david-cermak authored Apr 2, 2024
2 parents 1750a3f + d053d67 commit cb682a7
Show file tree
Hide file tree
Showing 45 changed files with 5,257 additions and 4 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/wifi_remote__build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "esp_wifi_remote: build-tests"

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
wifi_remote_api_compat:
if: contains(github.event.pull_request.labels.*.name, 'wifi_remote') || github.event_name == 'push'
name: Check API compatibility of WiFi Remote
strategy:
matrix:
idf_ver: ["latest"]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
- name: Check that headers are the same as generated
shell: bash
run: |
${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh
cd ./components/esp_wifi_remote/scripts
python generate_and_check.py
build_wifi_remote:
if: contains(github.event.pull_request.labels.*.name, 'wifi_remote') || github.event_name == 'push'
name: Build WiFi Remote
strategy:
matrix:
idf_ver: ["latest"]
test: [ { app: smoke_test, path: "test/smoke_test" }]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.idf_ver }}
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh
python ./ci/build_apps.py ./components/esp_wifi_remote/${{matrix.test.path}} -vv --preserve-all
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
rev: c0013808882a15a0c0c2c1a9b5c903866c53a653
hooks:
- id: astyle_py
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper']
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper', '--exclude-list=ci/ignore_astyle.txt']
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.42.1
hooks:
Expand All @@ -61,8 +61,8 @@ repos:
- repo: local
hooks:
- id: commit message scopes
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp)\)\:)'
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, wifi_remote"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|wifi_remote)\)\:)'
language: pygrep
args: [--multiline]
stages: [commit-msg]
3 changes: 2 additions & 1 deletion ci/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ def main():
changelog += '\n### {}\n\n'.format(sections[section])
for it in item:
changelog += '- {}\n'.format(it)
changelog += '\n'
filename = os.path.join(root_path, 'components', component, 'CHANGELOG.md')
# Check if the changelog file exists.
if not os.path.exists(filename):
# File does not exist, create it
with open(filename, 'w') as file:
file.write('# Changelog\n\n')
else:
changelog += '\n'
# insert the actual changelog to the beginning of the file, just after the title (2nd line)
with open(filename, 'r') as orig_changelog:
changelog_title = orig_changelog.readline(
Expand Down
2 changes: 2 additions & 0 deletions ci/ignore_astyle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The below file is generated from esp_wifi_types_native.h in IDF, which doesn't follow atyle
components/esp_wifi_remote/include/esp_wifi_types_native.h
8 changes: 8 additions & 0 deletions components/esp_wifi_remote/.cz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
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.1.12
version_files:
- idf_component.yml
8 changes: 8 additions & 0 deletions components/esp_wifi_remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## [0.1.12](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.1.12)

### Features

- Added generation step for wifi_remote based on IDF ([dfb00358](https://github.com/espressif/esp-protocols/commit/dfb00358))
- Move to esp-protocols ([edc3c2d](https://github.com/espressif/esp-protocols/commit/edc3c2d))
15 changes: 15 additions & 0 deletions components/esp_wifi_remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if(NOT CONFIG_ESP_WIFI_ENABLED)
set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_with_remote.c)
endif()

idf_component_register(INCLUDE_DIRS include
SRCS ${src_wifi_is_remote}
esp_wifi_remote_net.c
esp_wifi_remote_weak.c
REQUIRES esp_event esp_netif
PRIV_REQUIRES esp_wifi)

idf_component_optional_requires(PRIVATE esp_hosted)

idf_component_get_property(wifi esp_wifi COMPONENT_LIB)
target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB})
Loading

0 comments on commit cb682a7

Please sign in to comment.