mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-28 21:33:32 +00:00
feat(openthread): add mesh local prefix configuration
This commit is contained in:
9
examples/openthread/ot_cli/main/Kconfig.projbuild
Normal file
9
examples/openthread/ot_cli/main/Kconfig.projbuild
Normal file
@@ -0,0 +1,9 @@
|
||||
menu "OpenThread CLI Example"
|
||||
|
||||
config OPENTHREAD_AUTO_START
|
||||
bool 'Enable the automatic start mode.'
|
||||
default False
|
||||
help
|
||||
If enabled, the Openthread Device will create or connect to thread network with pre-configured
|
||||
network parameters automatically. Otherwise, user need to configure Thread via CLI command manually.
|
||||
endmenu
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*
|
||||
@@ -86,6 +86,11 @@ static void ot_task_worker(void *aContext)
|
||||
// Run the main loop
|
||||
#if CONFIG_OPENTHREAD_CLI
|
||||
esp_openthread_cli_create_task();
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_AUTO_START
|
||||
otOperationalDatasetTlvs dataset;
|
||||
otError error = otDatasetGetActiveTlvs(esp_openthread_get_instance(), &dataset);
|
||||
ESP_ERROR_CHECK(esp_openthread_auto_start((error == OT_ERROR_NONE) ? &dataset : NULL));
|
||||
#endif
|
||||
esp_openthread_launch_mainloop();
|
||||
|
||||
|
Reference in New Issue
Block a user