Skip to content

Commit 996c109

Browse files
feat(console): Moved wifi commands from idf examples
1 parent a363bee commit 996c109

File tree

9 files changed

+1971
-4
lines changed

9 files changed

+1971
-4
lines changed
+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
idf_component_register(SRCS "console_wifi.c"
2-
INCLUDE_DIRS "."
3-
PRIV_REQUIRES esp_netif console esp_wifi
4-
WHOLE_ARCHIVE)
2+
INCLUDE_DIRS "include"
3+
REQUIRES lwip
4+
PRIV_REQUIRES esp_netif console esp_wifi esp_timer)
5+
6+
if(CONFIG_WIFI_CMD_AUTO_REGISTRATION)
7+
target_link_libraries(${COMPONENT_LIB} "-u console_cmd_wifi_register")
8+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
menu "Wifi command Configuration"
2+
3+
config WIFI_CMD_AUTO_REGISTRATION
4+
bool "Enable Console command wifi Auto-registration"
5+
default y
6+
help
7+
Enabling this allows for the autoregistration of the wifi command.
8+
9+
endmenu

components/console_cmd_wifi/console_wifi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static esp_err_t do_cmd_wifi(int argc, char **argv)
260260
*/
261261
esp_err_t console_cmd_wifi_register(void)
262262
{
263-
esp_err_t ret;
263+
esp_err_t ret = ESP_OK;
264264
esp_console_cmd_t command = {
265265
.command = "wifi",
266266
.help = "Command for wifi configuration and monitoring\n For more info run 'wifi help'",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
14+
void register_wifi_cmd(void);
15+
void register_wifi_itwt(void);
16+
void register_wifi_stats(void);
17+
18+
19+
#ifdef __cplusplus
20+
}
21+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
14+
#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS
15+
16+
int wifi_cmd_get_tx_statistics(int argc, char **argv);
17+
int wifi_cmd_clr_tx_statistics(int argc, char **argv);
18+
19+
int wifi_cmd_get_rx_statistics(int argc, char **argv);
20+
int wifi_cmd_clr_rx_statistics(int argc, char **argv);
21+
22+
#endif
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif

0 commit comments

Comments
 (0)