Kaynağa Gözat

openthread: update openthread upstream

* openthread upstream(091f68ed)
zhangwenxu 2 yıl önce
ebeveyn
işleme
976cdd7d7e

+ 2 - 0
components/openthread/CMakeLists.txt

@@ -59,6 +59,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
         list(APPEND exclude_srcs
             "openthread/examples/apps/ncp/main.c"
             "openthread/src/core/api/backbone_router_api.cpp"
+            "openthread/src/core/api/child_supervision_api.cpp"
             "openthread/src/core/api/dataset_api.cpp"
             "openthread/src/core/api/dns_api.cpp"
             "openthread/src/core/api/entropy_api.cpp"
@@ -86,6 +87,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
             "openthread/src/core/thread/announce_begin_server.cpp"
             "openthread/src/core/thread/announce_sender.cpp"
             "openthread/src/core/thread/address_resolver.cpp"
+            "openthread/src/core/thread/child_supervision.cpp"
             "openthread/src/core/thread/discover_scanner.cpp"
             "openthread/src/core/thread/energy_scan_server.cpp"
             "openthread/src/core/thread/key_manager.cpp"

+ 7 - 0
components/openthread/Kconfig

@@ -130,6 +130,13 @@ menu "OpenThread"
             Select this option to enable SRP Client in OpenThread. This allows a device to register SRP services to SRP
             Server.
 
+    config OPENTHREAD_DNS_CLIENT
+        bool "Enable DNS Client"
+        depends on OPENTHREAD_ENABLED
+        default y
+        help
+            Select this option to enable DNS Client in OpenThread.
+
     config OPENTHREAD_BORDER_ROUTER
         bool "Enable Border Router"
         depends on OPENTHREAD_ENABLED

+ 1 - 1
components/openthread/openthread

@@ -1 +1 @@
-Subproject commit 19e18753c1ca97ffc68566f4852444f341e0319c
+Subproject commit 091f68ed706ce7a4831802408cdd0b0b4f309e3b

+ 1 - 1
components/openthread/port/esp_openthread_radio_uart.cpp

@@ -241,7 +241,7 @@ void otPlatRadioSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKe
 
 void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)
 {
-    SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter));
+    SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter, true));
 }
 
 #if OPENTHREAD_CONFIG_DIAG_ENABLE

+ 23 - 20
components/openthread/private_include/openthread-core-esp32x-ftd-config.h

@@ -213,6 +213,9 @@
 #define OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE 1
 #endif
 
+#endif // CONFIG_OPENTHREAD_BORDER_ROUTER
+
+#if !CONFIG_OPENTHREAD_RADIO_NATIVE
 /**
  * @def OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT
  *
@@ -224,25 +227,27 @@
 #define OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT 1
 #endif
 
-#endif // CONFIG_OPENTHREAD_BORDER_ROUTER
-
 /**
- * @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
+ * @def OPENTHREAD_POSIX_CONFIG_RCP_TIME_SYNC_INTERVAL
  *
- * Define to 1 to enable Thread Test Harness reference device support.
+ * This setting configures the interval (in units of microseconds) for host-rcp
+ * time sync. The host will recalculate the time offset between host and RCP
+ * every interval.
  *
  */
-#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 1
+#ifndef OPENTHREAD_POSIX_CONFIG_RCP_TIME_SYNC_INTERVAL
+#define OPENTHREAD_POSIX_CONFIG_RCP_TIME_SYNC_INTERVAL (60 * 1000 * 1000)
+#endif
+
+#endif
 
 /**
- * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE
+ * @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
  *
- * Define to 1 to enable Child Supervision support.
+ * Define to 1 to enable Thread Test Harness reference device support.
  *
  */
-#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE
-#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 1
-#endif
+#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 1
 
 /**
  * @def OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE
@@ -264,16 +269,6 @@
 #define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 1
 #endif
 
-/**
- * @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
- *
- * Define to 1 to enable DNS Client support.
- *
- */
-#ifndef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
-#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1
-#endif
-
 /**
  * @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE
  *
@@ -431,4 +426,12 @@
 #endif
 #endif
 
+/**
+ * @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
+ *
+ * Define to 1 to enable DNS Client support.
+ *
+ */
+#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE CONFIG_OPENTHREAD_DNS_CLIENT
+
 #define OPENTHREAD_FTD 1

+ 8 - 0
components/openthread/private_include/openthread-core-esp32x-mtd-config.h

@@ -230,4 +230,12 @@
 #endif
 #endif
 
+/**
+ * @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
+ *
+ * Define to 1 to enable DNS Client support.
+ *
+ */
+#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE CONFIG_OPENTHREAD_DNS_CLIENT
+
 #define OPENTHREAD_MTD 1

+ 16 - 7
examples/openthread/ot_ci_function.py

@@ -147,8 +147,7 @@ def get_linklocal_addr(dut:IdfDut) -> str:
 def get_global_unicast_addr(dut:IdfDut, br:IdfDut) -> str:
     dut_adress = ''
     clean_buffer(br)
-    br.write('br omrprefix')
-    omrprefix = br.expect(r'\n((?:\w+:){4}):/\d+\r', timeout=5)[1].decode()
+    omrprefix = get_omrprefix(br)
     clean_buffer(dut)
     dut.write('ipaddr')
     dut_adress = dut.expect(r'(%s(?:\w+:){3}\w+)\r' % str(omrprefix), timeout=5)[1].decode()
@@ -231,8 +230,7 @@ def clean_buffer(dut:IdfDut) -> None:
 def check_if_host_receive_ra(br:IdfDut) -> bool:
     interface_name = get_host_interface_name()
     clean_buffer(br)
-    br.write('br omrprefix')
-    omrprefix = br.expect(r'\n((?:\w+:){4}):/\d+\r', timeout=5)[1].decode()
+    omrprefix = get_omrprefix(br)
     command = 'ip -6 route | grep ' + str(interface_name)
     out_str = subprocess.getoutput(command)
     print('br omrprefix: ', str(omrprefix))
@@ -448,12 +446,11 @@ def create_host_tcp_server(mytcp:tcp_parameter) -> None:
 
 def get_ipv6_from_ipv4(ipv4_address:str, br:IdfDut) -> str:
     clean_buffer(br)
-    br.write('br nat64prefix')
-    omrprefix = br.expect(r'\n((?:\w+:){6}):/\d+', timeout=5)[1].decode()
+    nat64prefix = get_nat64prefix(br)
     ipv4_find = re.findall(r'\d+', ipv4_address)
     ipv6_16_1 = decimal_to_hex(ipv4_find[0]) + decimal_to_hex(ipv4_find[1])
     ipv6_16_2 = decimal_to_hex(ipv4_find[2]) + decimal_to_hex(ipv4_find[3])
-    ipv6_get_from_ipv4 = omrprefix + ':' + ipv6_16_1 + ':' + ipv6_16_2
+    ipv6_get_from_ipv4 = nat64prefix + ':' + ipv6_16_1 + ':' + ipv6_16_2
     return str(ipv6_get_from_ipv4)
 
 
@@ -461,3 +458,15 @@ def decimal_to_hex(decimal_str:str) -> str:
     decimal_int = int(decimal_str)
     hex_str = hex(decimal_int)[2:]
     return hex_str
+
+
+def get_omrprefix(br:IdfDut) -> str:
+    br.write('br omrprefix')
+    omrprefix = br.expect(r'Local: ((?:\w+:){4}):/\d+\r', timeout=5)[1].decode()
+    return str(omrprefix)
+
+
+def get_nat64prefix(br:IdfDut) -> str:
+    br.write('br nat64prefix')
+    nat64prefix = br.expect(r'Local: ((?:\w+:){6}):/\d+', timeout=5)[1].decode()
+    return str(nat64prefix)