Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aft_netif): Introduction of esp_netif with FreeRTOS+TCP stack #595

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "components/asio/asio"]
path = components/asio/asio
url = https://github.com/espressif/asio
[submodule "components/freertos_tcp/FreeRTOS-Plus-TCP"]
path = components/freertos_tcp/FreeRTOS-Plus-TCP
url = https://github.com/david-cermak/FreeRTOS-Plus-TCP.git
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, wifi_remote, tls_cxx"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|wifi_remote|tls_cxx)\)\:)'
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, wifi_remote, tls_cxx, aft_netif"
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|wifi_remote|tls_cxx|aft_netif)\)\:)'
language: pygrep
args: [--multiline]
stages: [commit-msg]
7 changes: 7 additions & 0 deletions ci/check_copyright_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ examples_and_unit_tests:
- CC0-1.0
license_for_new_files: Unlicense OR CC0-1.0

freertos_tcp_component:
include:
- 'components/freertos_tcp/port/**'
allowed_licenses:
- Apache-2.0
- MIT

asio_component:
include:
- 'components/asio/port/**'
Expand Down
64 changes: 64 additions & 0 deletions components/freertos_tcp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
set(fdir $ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos)
set(fcdir $ENV{IDF_PATH}/components/freertos/config/include/freertos)

set(fpt_dir FreeRTOS-Plus-TCP/source)
set(fpt_include_dir ${fpt_dir}/include ${fpt_dir}/portable/Compiler/GCC/)

set(fpt_srcs ${fpt_dir}/FreeRTOS_ARP.c
${fpt_dir}/FreeRTOS_BitConfig.c
${fpt_dir}/FreeRTOS_DHCP.c
${fpt_dir}/FreeRTOS_DHCPv6.c
${fpt_dir}/FreeRTOS_DNS.c
${fpt_dir}/FreeRTOS_DNS_Cache.c
${fpt_dir}/FreeRTOS_DNS_Callback.c
${fpt_dir}/FreeRTOS_DNS_Networking.c
${fpt_dir}/FreeRTOS_DNS_Parser.c
${fpt_dir}/FreeRTOS_ICMP.c
${fpt_dir}/FreeRTOS_IP.c
${fpt_dir}/FreeRTOS_IP_Timers.c
${fpt_dir}/FreeRTOS_IP_Utils.c
${fpt_dir}/FreeRTOS_IPv4.c
${fpt_dir}/FreeRTOS_IPv4_Sockets.c
${fpt_dir}/FreeRTOS_IPv4_Utils.c
${fpt_dir}/FreeRTOS_IPv6.c
${fpt_dir}/FreeRTOS_IPv6_Sockets.c
${fpt_dir}/FreeRTOS_IPv6_Utils.c
${fpt_dir}/FreeRTOS_ND.c
${fpt_dir}/FreeRTOS_RA.c
${fpt_dir}/FreeRTOS_Routing.c
${fpt_dir}/FreeRTOS_Sockets.c
${fpt_dir}/FreeRTOS_Stream_Buffer.c
${fpt_dir}/FreeRTOS_TCP_IP.c
${fpt_dir}/FreeRTOS_TCP_IP_IPv4.c
${fpt_dir}/FreeRTOS_TCP_IP_IPv6.c
${fpt_dir}/FreeRTOS_TCP_Reception.c
${fpt_dir}/FreeRTOS_TCP_State_Handling.c
${fpt_dir}/FreeRTOS_TCP_State_Handling_IPv4.c
${fpt_dir}/FreeRTOS_TCP_State_Handling_IPv6.c
${fpt_dir}/FreeRTOS_TCP_Transmission.c
${fpt_dir}/FreeRTOS_TCP_Transmission_IPv4.c
${fpt_dir}/FreeRTOS_TCP_Transmission_IPv6.c
${fpt_dir}/FreeRTOS_TCP_Utils.c
${fpt_dir}/FreeRTOS_TCP_Utils_IPv4.c
${fpt_dir}/FreeRTOS_TCP_Utils_IPv6.c
${fpt_dir}/FreeRTOS_TCP_WIN.c
${fpt_dir}/FreeRTOS_Tiny_TCP.c
${fpt_dir}/FreeRTOS_UDP_IP.c
${fpt_dir}/FreeRTOS_UDP_IPv4.c
${fpt_dir}/FreeRTOS_UDP_IPv6.c
${fpt_dir}/portable/BufferManagement/BufferAllocation_1.c
)

idf_component_register(SRCS ${fpt_srcs}
port/FreeRTOSIPConfig.c
port/NetworkInterface.c
port/FreeRTOS_AppHooks.c
esp_netif/interface.c
esp_netif/esp_netif_impl.c
INCLUDE_DIRS "port/include" ${fpt_include_dir} ${fdir}
PRIV_INCLUDE_DIRS ${fcdir}
PRIV_REQUIRES esp_wifi esp_netif)

target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
target_compile_definitions(${COMPONENT_LIB} PUBLIC "FREERTOS_CONFIG_H")
target_link_libraries(${COMPONENT_LIB} PRIVATE "-u _g_esp_netif_netstack_default_wifi_sta")
1 change: 1 addition & 0 deletions components/freertos_tcp/FreeRTOS-Plus-TCP
Submodule FreeRTOS-Plus-TCP added at d12c0d
27 changes: 27 additions & 0 deletions components/freertos_tcp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
menu "Amazon FreeRTOS plus TCP (AFpT)"

config AFPT_ENABLE
bool
default y
select ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION

config AFPT_LOCAL_HOSTNAME
string "Local netif hostname"
default 'espressif'
help
The default name this device will report to other devices on the network.
Could be updated at runtime with esp_netif_set_hostname()

config AFPT_IPV4
bool "Enable IPv4"
default y
help
Enable IPv4 stack. If you want to use IPv6 only TCP/IP stack, disable this.

config AFPT_IPV6
bool "Enable IPv6"
default y
help
Enable IPv6 function. If you want to use IPv4 only TCP/IP stack, disable this.

endmenu
Loading
Loading