Skip to content

Commit

Permalink
feat(console): Moved wifi commands from idf examples
Browse files Browse the repository at this point in the history
  • Loading branch information
espressif-abhikroy committed Feb 26, 2024
1 parent a363bee commit 996c109
Show file tree
Hide file tree
Showing 9 changed files with 1,971 additions and 4 deletions.
10 changes: 7 additions & 3 deletions components/console_cmd_wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
idf_component_register(SRCS "console_wifi.c"
INCLUDE_DIRS "."
PRIV_REQUIRES esp_netif console esp_wifi
WHOLE_ARCHIVE)
INCLUDE_DIRS "include"
REQUIRES lwip
PRIV_REQUIRES esp_netif console esp_wifi esp_timer)

if(CONFIG_WIFI_CMD_AUTO_REGISTRATION)
target_link_libraries(${COMPONENT_LIB} "-u console_cmd_wifi_register")
endif()
9 changes: 9 additions & 0 deletions components/console_cmd_wifi/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
menu "Wifi command Configuration"

config WIFI_CMD_AUTO_REGISTRATION
bool "Enable Console command wifi Auto-registration"
default y
help
Enabling this allows for the autoregistration of the wifi command.

endmenu
2 changes: 1 addition & 1 deletion components/console_cmd_wifi/console_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static esp_err_t do_cmd_wifi(int argc, char **argv)
*/
esp_err_t console_cmd_wifi_register(void)
{
esp_err_t ret;
esp_err_t ret = ESP_OK;
esp_console_cmd_t command = {
.command = "wifi",
.help = "Command for wifi configuration and monitoring\n For more info run 'wifi help'",
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions components/console_cmd_wifi/include/wifi_cmd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#ifdef __cplusplus
extern "C" {
#endif


void register_wifi_cmd(void);
void register_wifi_itwt(void);
void register_wifi_stats(void);


#ifdef __cplusplus
}
#endif
26 changes: 26 additions & 0 deletions components/console_cmd_wifi/include/wifi_stats.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#ifdef __cplusplus
extern "C" {
#endif


#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS

int wifi_cmd_get_tx_statistics(int argc, char **argv);
int wifi_cmd_clr_tx_statistics(int argc, char **argv);

int wifi_cmd_get_rx_statistics(int argc, char **argv);
int wifi_cmd_clr_rx_statistics(int argc, char **argv);

#endif

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 996c109

Please sign in to comment.