From 1f60b2102010153482a0df350a03cac82d1ae4cd Mon Sep 17 00:00:00 2001 From: Marcin Kajor Date: Mon, 22 Jul 2024 17:56:36 +0200 Subject: [PATCH] [nrf toup] [nrfconnect] Implement IPv6 agnostic L2 network state getters * Added new API for generic IPv6 connectivity checks * This patch allows the application layer to limit the amount of pre-processor logic (CONFIG_NET_L2_OPENTHREAD/CONFIG_CHIP_WIFI) needed to configure the Signed-off-by: Marcin Kajor --- .../nrfconnect/ConnectivityManagerImpl.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/platform/nrfconnect/ConnectivityManagerImpl.h b/src/platform/nrfconnect/ConnectivityManagerImpl.h index 8ea6c2d76b..e7d9fc4f4e 100644 --- a/src/platform/nrfconnect/ConnectivityManagerImpl.h +++ b/src/platform/nrfconnect/ConnectivityManagerImpl.h @@ -81,6 +81,32 @@ class ConnectivityManagerImpl final : public ConnectivityManager, // the implementation methods provided by this class. friend class ConnectivityManager; +public: + // Generic network status checkers + bool IsIPv6NetworkEnabled() + { + return false +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + || IsThreadEnabled() +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + || IsWiFiStationEnabled() +#endif + ; + }; + + bool IsIPv6NetworkProvisioned() + { + return false +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + || IsThreadProvisioned() +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + || IsWiFiStationProvisioned() +#endif + ; + } + private: // ===== Members that implement the ConnectivityManager abstract interface.