Skip to content

Commit 394af52

Browse files
committed
gmf_app_utils:
1. As `idf_component.yml` does not support variables, the Wi-Fi connection implementation from the IDF example is directly included in the `CMakeLists.txt` 2. Update the readme file
1 parent 8124aa1 commit 394af52

File tree

6 files changed

+93
-10
lines changed

6 files changed

+93
-10
lines changed

packages/gmf_app_utils/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

3-
## Unreleased
3+
4+
## v0.7.0
45

56
### Features
67

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
1-
get_directory_property(defined_defs COMPILE_DEFINITIONS)
2-
message("Defined preprocessor variables-USER: ${defined_defs}")
1+
set(extra_component_path "$ENV{IDF_PATH}/examples/common_components/protocol_examples_common")
32

4-
idf_component_register(SRC_DIRS "./src"
5-
INCLUDE_DIRS "./include"
6-
REQUIRES "sdmmc" "fatfs" "nvs_flash" "esp_wifi" "console" "esp_driver_i2c" "esp_netif" "unity")
3+
4+
set(EXTRA_SRCS "${extra_component_path}/stdin_out.c"
5+
"${extra_component_path}/addr_from_stdin.c"
6+
"${extra_component_path}/connect.c"
7+
"${extra_component_path}/wifi_connect.c"
8+
"${extra_component_path}/protocol_examples_utils.c")
9+
10+
if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD)
11+
list(APPEND EXTRA_SRCS "${extra_component_path}/console_cmd.c")
12+
endif()
13+
14+
if(CONFIG_EXAMPLE_CONNECT_ETHERNET)
15+
list(APPEND EXTRA_SRCS "${extra_component_path}/eth_connect.c")
16+
endif()
17+
18+
if(CONFIG_EXAMPLE_CONNECT_THREAD)
19+
list(APPEND EXTRA_SRCS "${extra_component_path}/thread_connect.c")
20+
endif()
21+
22+
if(CONFIG_EXAMPLE_CONNECT_PPP)
23+
list(APPEND EXTRA_SRCS "${extra_component_path}/ppp_connect.c")
24+
endif()
25+
26+
file(GLOB_RECURSE APP_SRCS "src/*.c")
27+
28+
idf_component_register(
29+
SRCS ${APP_SRCS} ${EXTRA_SRCS}
30+
INCLUDE_DIRS "include" "${extra_component_path}/include"
31+
REQUIRES "sdmmc" "fatfs" "nvs_flash" "esp_driver_i2c" "unity"
32+
PRIV_REQUIRES esp_netif esp_driver_gpio esp_driver_uart esp_wifi vfs console esp_eth openthread
33+
)
34+
35+
if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD)
36+
idf_component_optional_requires(PRIVATE console)
37+
endif()
38+
39+
if(CONFIG_EXAMPLE_CONNECT_ETHERNET)
40+
idf_component_optional_requires(PUBLIC esp_eth)
41+
endif()
42+
43+
if(CONFIG_EXAMPLE_CONNECT_THREAD)
44+
idf_component_optional_requires(PRIVATE openthread)
45+
endif()
46+
47+
if(CONFIG_EXAMPLE_CONNECT_PPP)
48+
idf_component_optional_requires(PRIVATE esp_tinyusb espressif__esp_tinyusb)
49+
endif()

packages/gmf_app_utils/Kconfig.projbuild

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
menu "GMF APP Configuration"
22

3+
# Extra components for wifi configuration
4+
source "${IDF_PATH}/examples/common_components/protocol_examples_common/Kconfig.projbuild"
5+
36
choice
47
prompt "Target Board"
58
default ESP32_S3_KORVO_V2_BOARD
@@ -78,4 +81,3 @@ menu "Unit Test"
7881
endmenu
7982

8083
endmenu
81-

packages/gmf_app_utils/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
GMF Application Utilities (gmf_app_utils) is a utility package that provides common convenient APIs for ESP GMF application development. It includes configurations for common peripheral setups such as Wi-Fi, SD card, and AudioCodec initialization, as well as system management functions like performance monitoring interfaces and serial terminal command line interface (CLI).
88

9+
The `gmf_app_utils` component also provides configuration options via **menuconfig**:
10+
11+
* **Configure network parameters (e.g., SSID and Password)**
12+
13+
Navigate to: `GMF APP Configuration``Example Connection Configuration``WiFi SSID` and `WiFi Password`
14+
15+
* **Select the target development board**
16+
17+
Navigate to: `GMF APP Configuration``Target Board`
18+
19+
* **Adjust the unit test task priority**
20+
21+
Navigate to: `GMF APP Configuration``Unit Test`
22+
923
## Features
1024

1125
### Peripheral Management (`esp_gmf_app_setup_peripheral.h`)

packages/gmf_app_utils/README_CN.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
GMF 应用工具包(gmf_app_utils)是一个为方便 ESP GMF 开发应用程序而提供的常用便捷 API,它包含常见外设设置的配置,比如 Wi-Fi、SD card、AudioCodec 初始化,还包括一些系统管理功能,如性能监控接口和串口终端命令行接口(CLI)。
88

9+
同时 gmf_app_utils 提供了 menuconfig 进行参数配置:
10+
11+
- 配置网络参数(如:SSID 和 Password)
12+
13+
选择路径是:`GMF APP Configuration` -> `Example Connection Configuration` -> `WiFi SSID``WiFi Password`
14+
15+
- 选择开发板
16+
17+
选择路径是:`GMF APP Configuration` -> `Target Board`
18+
19+
- 调整 Unit test 任务优先级
20+
21+
选择路径是:`GMF APP Configuration` -> `Unit Test`
22+
923
## 功能特性
1024

1125
### 外设管理(`esp_gmf_app_setup_peripheral.h`
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
2+
version: "0.7.0"
3+
description: Espressif GMF App Utils is a module that provides utility functions for the GMF application
4+
url: https://github.com/espressif/esp-gmf/tree/main/packages/gmf_app_utils
5+
documentation: "https://github.com/espressif/esp-gmf/blob/main/packages/gmf_app_utils/README.md"
6+
issues: "https://github.com/espressif/esp-gmf/issues"
7+
8+
tags:
9+
- "gmf"
10+
- "gmf_app"
11+
112
dependencies:
213
espressif/gmf_core:
3-
version: "^0.6"
4-
protocol_examples_common:
5-
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
14+
version: "^0.7"
615
tempotian/codec_board:
716
version: "^0.5.0"

0 commit comments

Comments
 (0)