From 0453d1d97922664e02e89b02e1edf74f74f93f28 Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Thu, 15 Sep 2022 20:16:54 -0500 Subject: [PATCH] add interface IPv6 addresses and up fabrics for SVE#2 (#22644) * add interface IPv6 addresses and up fabrics for SVE#2 * reduce all-clusters-app stack to match lock-app --- .../all-clusters-app/cc13x2x7_26x2x7/main/main.cpp | 2 +- .../cc13x2x7_26x2x7/main/main.cpp | 2 +- src/platform/cc13x2_26x2/CHIPPlatformConfig.h | 4 ++-- .../cc13x2_26x2/DiagnosticDataProviderImpl.cpp | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp index b432b8da888b34..cb0641fbc85ee0 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/main.cpp @@ -38,7 +38,7 @@ #include #include -#define TOTAL_ICALL_HEAP_SIZE (58000) +#define TOTAL_ICALL_HEAP_SIZE (0xc800) using namespace ::chip; using namespace ::chip::Inet; diff --git a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/main.cpp b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/main.cpp index b432b8da888b34..cb0641fbc85ee0 100644 --- a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/main.cpp +++ b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/main.cpp @@ -38,7 +38,7 @@ #include #include -#define TOTAL_ICALL_HEAP_SIZE (58000) +#define TOTAL_ICALL_HEAP_SIZE (0xc800) using namespace ::chip; using namespace ::chip::Inet; diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h index 7b1d71b0e64123..2a5981d4bbdea6 100644 --- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h @@ -66,5 +66,5 @@ // Limit the number of device admins to ensure enough ressources for handling them #ifndef CHIP_CONFIG_MAX_FABRICS -#define CHIP_CONFIG_MAX_FABRICS 3 // Don't reserve one for rotation slack due to limited resources -#endif // CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif diff --git a/src/platform/cc13x2_26x2/DiagnosticDataProviderImpl.cpp b/src/platform/cc13x2_26x2/DiagnosticDataProviderImpl.cpp index ad87f7646188e8..f2126f30533b3f 100644 --- a/src/platform/cc13x2_26x2/DiagnosticDataProviderImpl.cpp +++ b/src/platform/cc13x2_26x2/DiagnosticDataProviderImpl.cpp @@ -251,6 +251,20 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ThreadStackMgrImpl().GetExtAddress(extAddr); ifp->hardwareAddress = ByteSpan(extAddr.m8, OT_EXT_ADDRESS_SIZE); + /* Thread only support IPv6 */ + uint8_t ipv6AddressesCount = 0; + for (Inet::InterfaceAddressIterator iterator; iterator.Next() && ipv6AddressesCount < kMaxIPv6AddrCount;) + { + chip::Inet::IPAddress ipv6Address; + if (iterator.GetAddress(ipv6Address) == CHIP_NO_ERROR) + { + memcpy(ifp->Ipv6AddressesBuffer[ipv6AddressesCount], ipv6Address.Addr, kMaxIPv6AddrSize); + ifp->Ipv6AddressSpans[ipv6AddressesCount] = ByteSpan(ifp->Ipv6AddressesBuffer[ipv6AddressesCount]); + ipv6AddressesCount++; + } + } + ifp->IPv6Addresses = app::DataModel::List(ifp->Ipv6AddressSpans, ipv6AddressesCount); + *netifpp = ifp; return CHIP_NO_ERROR; }