Skip to content

Commit

Permalink
[nrf toup] [nrfconnect] Implement IPv6 agnostic L2 network state getters
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
markaj-nordic committed Jul 24, 2024
1 parent 0ada603 commit 1f60b21
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/platform/nrfconnect/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 1f60b21

Please sign in to comment.