Merge branch 'feature/ot-multicast-routing' into 'master'

openthread: enable 1.2 multicast routing

See merge request espressif/esp-idf!16943
This commit is contained in:
Shu Chen
2022-01-28 15:43:04 +00:00
5 changed files with 40 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -204,6 +204,16 @@
#define OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE CONFIG_OPENTHREAD_TREL
#endif
/**
* @def OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
*
* Define to 1 to enable Backbone Router support.
*
*/
#ifndef OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
#define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 1
#endif
#endif // CONFIG_OPENTHREAD_BORDER_ROUTER
/**
@@ -356,6 +366,26 @@
*/
#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_DUA_ENABLE
*
* Define as 1 to support Thread 1.2 Domain Unicast Address feature.
*
*/
#ifndef OPENTHREAD_CONFIG_DUA_ENABLE
#define OPENTHREAD_CONFIG_DUA_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_MLR_ENABLE
*
* Define as 1 to support Thread 1.2 Multicast Listener Registration feature.
*
*/
#ifndef OPENTHREAD_CONFIG_MLR_ENABLE
#define OPENTHREAD_CONFIG_MLR_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_DTLS_MAX_CONTENT_LEN
*

View File

@@ -37,9 +37,9 @@
#include "sdkconfig.h"
#include "driver/uart.h"
#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h"
#include "freertos/task.h"
#include "hal/uart_types.h"
#include "openthread/backbone_router_ftd.h"
#include "openthread/border_router.h"
#include "openthread/cli.h"
#include "openthread/dataset.h"
@@ -50,7 +50,6 @@
#include "openthread/ip6.h"
#include "openthread/logging.h"
#include "openthread/tasklet.h"
#include "openthread/thread.h"
#include "openthread/thread_ftd.h"
#include "esp_ot_wifi_cmd.h"
#include "esp_ot_cli_extension.h"
@@ -137,10 +136,6 @@ static void create_config_network(otInstance *instance)
ESP_LOGE(TAG, "Failed to set OpenThread active dataset.");
abort();
}
if (otBorderRouterRegister(instance) != OT_ERROR_NONE) {
ESP_LOGE(TAG, "Failed to register border router.");
abort();
}
return;
}
@@ -154,6 +149,11 @@ static void launch_openthread_network(otInstance *instance)
ESP_LOGE(TAG, "Failed to enable OpenThread");
abort();
}
if (otBorderRouterRegister(instance) != OT_ERROR_NONE) {
ESP_LOGE(TAG, "Failed to register border router.");
abort();
}
otBackboneRouterSetEnabled(instance, true);
}
#endif // CONFIG_OPENTHREAD_BR_AUTO_START

View File

@@ -43,6 +43,7 @@ CONFIG_LWIP_MULTICAST_PING=y
CONFIG_LWIP_NETIF_STATUS_CALLBACK=y
CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM=y
# end of lwIP
#