Skip to content

Commit b6b20ad

Browse files
mDNS: Initial version based on IDF 5.0
1 parent 8863ed9 commit b6b20ad

File tree

105 files changed

+312
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+312
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build mDNS
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
idf_ver: ["latest"]
10+
idf_target: ["esp32", "esp32s2", "esp32c3"]
11+
12+
runs-on: ubuntu-20.04
13+
container: espressif/idf:${{ matrix.idf_ver }}
14+
steps:
15+
- name: Checkout esp-protocols
16+
uses: actions/checkout@master
17+
with:
18+
path: esp-protocols
19+
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
20+
env:
21+
IDF_TARGET: ${{ matrix.idf_target }}
22+
shell: bash
23+
run: |
24+
. ${IDF_PATH}/export.sh
25+
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/
26+
cat sdkconfig.ci.eth_def >> sdkconfig.defaults
27+
idf.py build
28+
rm sdkconfig.defaults
29+
cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults
30+
idf.py build
31+
rm sdkconfig.defaults
32+
cat sdkconfig.ci.eth_socket >> sdkconfig.defaults
33+
idf.py build
34+
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/
35+
idf.py build

.github/workflows/publish-docs-component.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,36 @@ jobs:
2121
run: |
2222
sudo apt-get update
2323
sudo apt-get -y install doxygen clang python3-pip
24-
python -m pip install breathe recommonmark esp-docs==0.2.1
24+
python -m pip install breathe recommonmark esp-docs
2525
cd $GITHUB_WORKSPACE/components/esp_modem/docs
2626
./generate_docs
2727
mkdir -p $GITHUB_WORKSPACE/docs/esp_modem
2828
cp -r html/. $GITHUB_WORKSPACE/docs/esp_modem
29+
2930
cd $GITHUB_WORKSPACE/components/esp_websocket_client/docs
3031
./generate_docs
3132
mkdir -p $GITHUB_WORKSPACE/docs/esp_websocket_client
3233
cp -r html/. $GITHUB_WORKSPACE/docs/esp_websocket_client
34+
35+
cd $GITHUB_WORKSPACE/components/mdns/docs
36+
./generate_docs
37+
mkdir -p $GITHUB_WORKSPACE/docs/mdns/en
38+
mkdir -p $GITHUB_WORKSPACE/docs/mdns/zh_CN
39+
cp -r html_en/. $GITHUB_WORKSPACE/docs/mdns/en
40+
cp -r html_zh_CN/. $GITHUB_WORKSPACE/docs/mdns/zh_CN
41+
3342
cd $GITHUB_WORKSPACE/docs
3443
touch .nojekyll
35-
echo '<a href="esp_modem/index.html">esp-modem</a>' > index.html
36-
echo '<a href="esp_websocket_client/index.html">esp-websocket-client</a>' >> index.html
44+
echo '<a href="esp_modem/index.html">esp-modem</a><br>' > index.html
45+
echo '<a href="esp_websocket_client/index.html">esp-websocket-client</a><br>' >> index.html
46+
echo '<a href="mdns/en/index.html">mDNS_en</a><br>' >> index.html
47+
echo '<a href="mdns/zh_CN/index.html">mDNS_zh_CN</a><br>' >> index.html
3748
3849
3950
- name: Upload components to component service
4051
uses: espressif/github-actions/upload_components@master
4152
with:
42-
directories: "components/esp_modem;components/esp_websocket_client"
53+
directories: "components/esp_modem;components/esp_websocket_client;components/mdns"
4354
namespace: "espressif"
4455
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
4556

.github/workflows/test_afl_fuzzer.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: AFL fuzzer compilation test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
idf_ver: ["latest"]
10+
idf_target: ["esp32"]
11+
12+
runs-on: ubuntu-20.04
13+
container: espressif/idf:${{ matrix.idf_ver }}
14+
steps:
15+
- name: Checkout esp-protocols
16+
uses: actions/checkout@master
17+
with:
18+
path: esp-protocols
19+
- name: Install Necessary Libs
20+
run: |
21+
apt-get update -y
22+
apt-get install -y libbsd-dev
23+
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
24+
env:
25+
IDF_TARGET: ${{ matrix.idf_target }}
26+
shell: bash
27+
run: |
28+
. ${IDF_PATH}/export.sh
29+
cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_afl_fuzz_host/
30+
make INSTR=off

README.md

+5

components/mdns/README.md

+11

components/mdns/docs/Doxyfile

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This is Doxygen configuration file
2+
#
3+
# Doxygen provides over 260 configuration statements
4+
# To make this file easier to follow,
5+
# it contains only statements that are non-default
6+
#
7+
# NOTE:
8+
# It is recommended not to change defaults unless specifically required
9+
# Test any changes how they affect generated documentation
10+
# Make sure that correct warnings are generated to flag issues with documented code
11+
#
12+
# For the complete list of configuration statements see:
13+
# http://doxygen.nl/manual/config.html
14+
15+
16+
PROJECT_NAME = "ESP Protocols Programming Guide"
17+
18+
## The 'INPUT' statement below is used as input by script 'gen-df-input.py'
19+
## to automatically generate API reference list files heder_file.inc
20+
## These files are placed in '_inc' directory
21+
## and used to include in API reference documentation
22+
23+
INPUT = \
24+
$(PROJECT_PATH)/include/mdns.h
25+
26+
## Get warnings for functions that have no documentation for their parameters or return value
27+
##
28+
WARN_NO_PARAMDOC = YES
29+
30+
## Enable preprocessing and remove __attribute__(...) expressions from the INPUT files
31+
##
32+
ENABLE_PREPROCESSING = YES
33+
MACRO_EXPANSION = YES
34+
EXPAND_ONLY_PREDEF = YES
35+
PREDEFINED = \
36+
$(ENV_DOXYGEN_DEFINES) \
37+
__DOXYGEN__=1 \
38+
__attribute__(x)= \
39+
_Static_assert()= \
40+
IDF_DEPRECATED(X)= \
41+
IRAM_ATTR= \
42+
configSUPPORT_DYNAMIC_ALLOCATION=1 \
43+
configSUPPORT_STATIC_ALLOCATION=1 \
44+
configQUEUE_REGISTRY_SIZE=1 \
45+
configUSE_RECURSIVE_MUTEXES=1 \
46+
configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS=1 \
47+
configNUM_THREAD_LOCAL_STORAGE_POINTERS=1 \
48+
configUSE_APPLICATION_TASK_TAG=1 \
49+
configTASKLIST_INCLUDE_COREID=1 \
50+
"ESP_EVENT_DECLARE_BASE(x)=extern esp_event_base_t x"
51+
52+
## Do not complain about not having dot
53+
##
54+
HAVE_DOT = NO
55+
56+
## Generate XML that is required for Breathe
57+
##
58+
GENERATE_XML = YES
59+
XML_OUTPUT = xml
60+
61+
GENERATE_HTML = NO
62+
HAVE_DOT = NO
63+
GENERATE_LATEX = NO
64+
GENERATE_MAN = YES
65+
GENERATE_RTF = NO
66+
67+
## Skip distracting progress messages
68+
##
69+
QUIET = YES
70+
71+
## Enable Section Tags for conditional documentation
72+
##
73+
ENABLED_SECTIONS += \
74+
DOC_EXCLUDE_HEADER_SECTION \ ## To conditionally remove doc sections from IDF source files without affecting documentation in upstream files.
75+
DOC_SINGLE_GROUP ## To conditionally remove groups from the documentation and create a 'flat' document without affecting documentation in upstream files.

components/mdns/docs/conf_common.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from esp_docs.conf_docs import * # noqa: F403,F401
2+
3+
extensions += ['sphinx_copybutton',
4+
# Needed as a trigger for running doxygen
5+
'esp_docs.esp_extensions.dummy_build_system',
6+
'esp_docs.esp_extensions.run_doxygen',
7+
]
8+
9+
# link roles config
10+
github_repo = 'espressif/esp-protocols'
11+
12+
# context used by sphinx_idf_theme
13+
html_context['github_user'] = 'espressif'
14+
html_context['github_repo'] = 'esp-protocols'
15+
16+
# Extra options required by sphinx_idf_theme
17+
project_slug = 'esp-idf' # >=5.0
18+
versions_url = 'https://github.com/espressif/esp-protocols/docs/docs_versions.js'
19+
20+
idf_targets = ['esp32']
21+
languages = ['en', 'zh_CN']

components/mdns/docs/en/conf.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# English Language RTD & Sphinx config file
4+
#
5+
# Uses ../conf_common.py for most non-language-specific settings.
6+
7+
# Importing conf_common adds all the non-language-specific
8+
# parts to this conf module
9+
10+
try:
11+
from conf_common import * # noqa: F403,F401
12+
except ImportError:
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('../'))
16+
from conf_common import * # noqa: F403,F401
17+
18+
# General information about the project.
19+
project = u'ESP-Protocols'
20+
copyright = u'2016 - 2022, Espressif Systems (Shanghai) Co., Ltd'
21+
22+
# The language for content autogenerated by Sphinx. Refer to documentation
23+
# for a list of supported languages.
24+
language = 'en'

docs/en/api-reference/protocols/mdns.rst components/mdns/docs/en/index.rst

+18-2

components/mdns/docs/generate_docs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
build-docs --target esp32 --language en
2+
build-docs --target esp32 --language zh_CN
3+
4+
cp -rf _build/en/esp32/html html_en
5+
cp -rf _build/zh_CN/esp32/html html_zh_CN
6+
rm -rf _build __pycache__ tee
7+
8+
# Modifes some version and target fields of index.html
9+
echo "<script type="text/javascript">
10+
window.onload =(function() {
11+
var myAnchor = document.getElementById('version-select');
12+
var mySpan = document.createElement('input');
13+
mySpan.setAttribute('type', 'text');
14+
mySpan.setAttribute('maxLength', '10');
15+
mySpan.value = 'latest';
16+
mySpan.setAttribute('disabled', true);
17+
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
18+
19+
var myAnchor = document.getElementById('target-select');
20+
var mySpan = document.createElement('input');
21+
mySpan.setAttribute('type', 'text');
22+
mySpan.setAttribute('maxLength', '10');
23+
mySpan.value = 'all targets';
24+
mySpan.setAttribute('disabled', true);
25+
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
26+
27+
})();
28+
</script>" | tee -a html_en/index.html html_zh_CN/index.html > /dev/null

components/mdns/docs/zh_CN/conf.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# English Language RTD & Sphinx config file
4+
#
5+
# Uses ../conf_common.py for most non-language-specific settings.
6+
7+
# Importing conf_common adds all the non-language-specific
8+
# parts to this conf module
9+
try:
10+
from conf_common import * # noqa: F403,F401
11+
except ImportError:
12+
import os
13+
import sys
14+
sys.path.insert(0, os.path.abspath('..'))
15+
from conf_common import * # noqa: F403,F401
16+
17+
import datetime
18+
19+
current_year = datetime.datetime.now().year
20+
21+
# General information about the project.
22+
project = u'ESP-IDF 编程指南'
23+
copyright = u'2016 - {} 乐鑫信息科技(上海)股份有限公司'.format(current_year)
24+
25+
# The language for content autogenerated by Sphinx. Refer to documentation
26+
# for a list of supported languages.
27+
language = 'zh_CN'

docs/zh_CN/api-reference/protocols/mdns.rst components/mdns/docs/zh_CN/index.rst

+2-2

examples/protocols/mdns/CMakeLists.txt components/mdns/examples/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.5)
44

5-
# (Not part of the boilerplate)
5+
set(EXTRA_COMPONENT_DIRS "../..")
66
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
7-
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
7+
list(APPEND EXTRA_COMPONENT_DIRS "../../../common_components/protocol_examples_common")
88

99
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
1010
project(mdns_test)

examples/protocols/mdns/README.md components/mdns/examples/README.md

+1-3

0 commit comments

Comments
 (0)