-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common): Added simple component for console initialization
- Loading branch information
1 parent
6dcca59
commit 9a27a40
Showing
27 changed files
with
498 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
idf_component_register(SRCS "console_ifconfig.c" | ||
INCLUDE_DIRS "." | ||
REQUIRES "ethernet_init" | ||
PRIV_REQUIRES esp_netif console esp_eth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
components/console_cmd_ifconfig/examples/ifconfig-basic/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# For more information about build system see | ||
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html | ||
# The following five lines of boilerplate have to be in your project's | ||
# CMakeLists in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(ifconfig-basic) |
2 changes: 2 additions & 0 deletions
2
components/console_cmd_ifconfig/examples/ifconfig-basic/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
idf_component_register(SRCS "ifconfig-basic.c" | ||
INCLUDE_DIRS ".") |
6 changes: 6 additions & 0 deletions
6
components/console_cmd_ifconfig/examples/ifconfig-basic/main/idf_component.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
idf: | ||
version: '>=5.1' | ||
console_cmd_ifconfig: | ||
version: "*" | ||
override_path: '../../../' |
33 changes: 33 additions & 0 deletions
33
components/console_cmd_ifconfig/examples/ifconfig-basic/main/ifconfig-basic.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include <stdio.h> | ||
#include "esp_netif.h" | ||
#include "nvs_flash.h" | ||
#include "esp_netif.h" | ||
#include "esp_event.h" | ||
#include "console_ifconfig.h" | ||
|
||
|
||
void app_main(void) | ||
{ | ||
ESP_ERROR_CHECK(esp_netif_init()); | ||
ESP_ERROR_CHECK(esp_event_loop_create_default()); | ||
esp_err_t ret = nvs_flash_init(); //Initialize NVS | ||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { | ||
ESP_ERROR_CHECK(nvs_flash_erase()); | ||
ret = nvs_flash_init(); | ||
} | ||
ESP_ERROR_CHECK(ret); | ||
|
||
// Initialize console REPL | ||
ESP_ERROR_CHECK(console_cmd_init()); | ||
|
||
ESP_ERROR_CHECK(console_cmd_ifconfig_register()); | ||
|
||
// start console REPL | ||
ESP_ERROR_CHECK(console_cmd_start()); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
version: 0.0.9 | ||
version: 1.0.0 | ||
url: https://github.com/espressif/esp-protocols/tree/master/components/console_cmd_ifconfig | ||
description: The component offers a console that enables runtime network interface configuration and monitoring. | ||
dependencies: | ||
idf: | ||
version: '>=5.0' | ||
ethernet_init: | ||
espressif/console_simple_init: | ||
version: '>=0.0.1' | ||
espressif/ethernet_init: | ||
version: '>=0.0.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
components/console_cmd_ping/examples/ping-basic/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# For more information about build system see | ||
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html | ||
# The following five lines of boilerplate have to be in your project's | ||
# CMakeLists in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(ping-basic) |
2 changes: 2 additions & 0 deletions
2
components/console_cmd_ping/examples/ping-basic/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
idf_component_register(SRCS "ping-basic.c" | ||
INCLUDE_DIRS ".") |
6 changes: 6 additions & 0 deletions
6
components/console_cmd_ping/examples/ping-basic/main/idf_component.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
idf: | ||
version: '>=5.1' | ||
console_cmd_ping: | ||
version: "*" | ||
override_path: '../../../' |
34 changes: 34 additions & 0 deletions
34
components/console_cmd_ping/examples/ping-basic/main/ping-basic.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include <stdio.h> | ||
#include "esp_netif.h" | ||
#include "nvs_flash.h" | ||
#include "esp_netif.h" | ||
#include "esp_event.h" | ||
#include "console_ping.h" | ||
|
||
|
||
void app_main(void) | ||
{ | ||
ESP_ERROR_CHECK(esp_netif_init()); | ||
ESP_ERROR_CHECK(esp_event_loop_create_default()); | ||
esp_err_t ret = nvs_flash_init(); //Initialize NVS | ||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { | ||
ESP_ERROR_CHECK(nvs_flash_erase()); | ||
ret = nvs_flash_init(); | ||
} | ||
ESP_ERROR_CHECK(ret); | ||
|
||
// Initialize console REPL | ||
ESP_ERROR_CHECK(console_cmd_init()); | ||
|
||
// Register ping command | ||
ESP_ERROR_CHECK(console_cmd_ping_register()); | ||
|
||
// start console REPL | ||
ESP_ERROR_CHECK(console_cmd_start()); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
version: 0.0.4 | ||
version: 1.0.0 | ||
url: https://github.com/espressif/esp-protocols/tree/master/components/console_cmd_ping | ||
description: The component provides a console where the 'ping' command can be executed. | ||
dependencies: | ||
idf: | ||
version: '>=5.0' | ||
espressif/console_simple_init: | ||
version: '>=0.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
idf_component_register(SRCS "console_simple_init.c" | ||
INCLUDE_DIRS "." | ||
PRIV_REQUIRES console) |
Oops, something went wrong.