Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Enable IPv6 for WiFi (rs911x) #19071

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ declare_args() {

# Disable LCD on supported devices
disable_lcd = false

# Disable IPv4 for rs911
chip_disable_wifi_ipv4 = false
}

declare_args() {
Expand Down Expand Up @@ -214,6 +217,10 @@ efr32_executable("lighting_app") {
sources += [ "${examples_plat_dir}/OTAConfig.cpp" ]
}

if (chip_disable_wifi_ipv4) {
defines += [ "WIFI_IPV4_DISABLED" ]
}

# WiFi Settings
if (chip_enable_wifi) {
if (use_rs911x) {
Expand Down
4 changes: 4 additions & 0 deletions scripts/examples/gn_efr32_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ else
optArgs+="enable_sleepy_device=true chip_openthread_ftd=false "
shift
;;
chip_disable_wifi_ipv4)
optArgs+="chip_disable_wifi_ipv4=true "
shift
;;
*)
if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
Expand Down
12 changes: 12 additions & 0 deletions src/platform/EFR32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@

#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0

#if defined(RS911X_WIFI)

#if defined(WIFI_IPV4_DISABLED)
#define CHIP_DEVICE_CONFIG_ENABLE_IPV4 0
#define CHIP_DEVICE_CONFIG_ENABLE_IPV6 1
#else
#define CHIP_DEVICE_CONFIG_ENABLE_IPV4 1
#define CHIP_DEVICE_CONFIG_ENABLE_IPV6 1
#endif

#endif

// ========== Platform-specific Configuration =========

// These are configuration options that are unique to the EFR32 platform.
Expand Down
5 changes: 4 additions & 1 deletion src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <platform/internal/GenericConnectivityManagerImpl_BLE.ipp>
#endif

#include "CHIPDevicePlatformConfig.h"
#include "wfx_host_events.h"

using namespace ::chip;
Expand Down Expand Up @@ -388,8 +389,10 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void)
if (mWiFiStationState == kWiFiStationState_Connected)
{
#if 1 //! defined (SL_WF200) || (SL_WF200 == 0)

haveIPv4Conn = wfx_have_ipv4_addr(SL_WFX_STA_INTERFACE);
#if (CHIP_DEVICE_CONFIG_ENABLE_IPV6)
haveIPv6Conn = wfx_have_ipv6_addr(SL_WFX_STA_INTERFACE);
#endif
/* TODO - haveIPv6Conn */
#else /* Old code that needed LWIP and its internals */
// Get the LwIP netif for the WiFi station interface.
Expand Down