Skip to content

Commit

Permalink
Remove the AP related stuff from connectedhomeip ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
shripad621git committed Sep 2, 2024
1 parent 7085588 commit ffb52a1
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 524 deletions.
2 changes: 1 addition & 1 deletion config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ if (CONFIG_ENABLE_CHIP_CONTROLLER_BUILD)
chip_gn_arg_append("chip_build_controller" "true")
endif()

if (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP)
if (CONFIG_ENABLE_WIFI_STATION)
chip_gn_arg_append("chip_enable_wifi" "true")
else()
chip_gn_arg_append("chip_enable_wifi" "false")
Expand Down
52 changes: 0 additions & 52 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -613,58 +613,6 @@ menu "CHIP Device Layer"

endmenu

menu "WiFi AP Options"

config ENABLE_WIFI_AP
depends on ESP_WIFI_SOFTAP_SUPPORT
bool "Enable CHIP WIFI AP"
default y
help
Enables WiFi AP for CHIP.

config WIFI_AP_SSID_PREFIX
string "WiFi AP SSID Prefix"
default "MATTER-"
depends on ENABLE_WIFI_AP
help
A prefix string used in forming the WiFi soft-AP SSID. The remainder of the SSID
consists of the final two bytes of the device's primary WiFi MAC address in hex.

config WIFI_AP_CHANNEL
int "WiFi AP Channel"
range 1 14
default 1
depends on ENABLE_WIFI_AP
help
The WiFi channel number to be used by the soft-AP.

config WIFI_AP_MAX_STATIONS
int "WiFi AP Max Allowed Stations"
range 1 10
default 4
depends on ENABLE_WIFI_AP
help
The maximum number of stations allowed to connect to the soft-AP.

config WIFI_AP_BEACON_INTERVAL
int "WiFi AP Beacon Interval (ms)"
range 100 60000
default 100
depends on ENABLE_WIFI_AP
help
The beacon interval (in milliseconds) for the WiFi soft-AP.

config WIFI_AP_IDLE_TIMEOUT
int "WiFi AP Idle Timeout (ms)"
range 0 600000
default 120000
depends on ENABLE_WIFI_AP
help
The amount of time (in milliseconds) after which the CHIP platform will deactivate the soft-AP
if it has been idle.

endmenu

menu "BLE Options"
visible if BT_ENABLED

Expand Down
9 changes: 1 addition & 8 deletions src/platform/ESP32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,13 @@
#define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET 0
#endif // CONFIG_ENABLE_ETHERNET_TELEMETRY

#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP | CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY CONFIG_ENABLE_WIFI_TELEMETRY
#define CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL CONFIG_WIFI_STATION_RECONNECT_INTERVAL
#define CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS CONFIG_MAX_SCAN_NETWORKS_RESULTS
#define CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT
#define CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT CONFIG_WIFI_CONNECTIVITY_TIMEOUT
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
#define CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX CONFIG_WIFI_AP_SSID_PREFIX
#define CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL CONFIG_WIFI_AP_CHANNEL
#define CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS CONFIG_WIFI_AP_MAX_STATIONS
#define CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL CONFIG_WIFI_AP_BEACON_INTERVAL
#define CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT CONFIG_WIFI_AP_IDLE_TIMEOUT
#endif /* CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP */
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

#ifdef CONFIG_ENABLE_ICD_SERVER
Expand Down
6 changes: 0 additions & 6 deletions src/platform/ESP32/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0
#endif

#ifdef CONFIG_ENABLE_WIFI_AP
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 1
#else
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#endif

#ifdef CONFIG_ENABLE_ICD_SERVER

#ifndef CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC
Expand Down
44 changes: 0 additions & 44 deletions src/platform/ESP32/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,6 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
void ChangeWiFiStationState(WiFiStationState newState);
static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState);

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
WiFiAPMode _GetWiFiAPMode(void);
CHIP_ERROR _SetWiFiAPMode(WiFiAPMode val);
bool _IsWiFiAPActive(void);
void _DemandStartWiFiAP(void);
void _StopOnDemandWiFiAP(void);
void _MaintainOnDemandWiFiAP(void);
System::Clock::Timeout _GetWiFiAPIdleTimeout(void);
void _SetWiFiAPIdleTimeout(System::Clock::Timeout val);
bool _IsWiFiAPApplicationControlled(void);

System::Clock::Timestamp mLastAPDemandTime;
WiFiAPMode mWiFiAPMode;
WiFiAPState mWiFiAPState;
System::Clock::Timeout mWiFiAPIdleTimeout;

void DriveAPState(void);
CHIP_ERROR ConfigureWiFiAP(void);
void ChangeWiFiAPState(WiFiAPState newState);
static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState);
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP

void UpdateInternetConnectivityState(void);
void OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip);
void OnStationIPv4AddressLost(void);
Expand Down Expand Up @@ -198,28 +176,6 @@ inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiStationReconnectI
return mWiFiStationReconnectInterval;
}

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
inline ConnectivityManager::WiFiAPMode ConnectivityManagerImpl::_GetWiFiAPMode(void)
{
return mWiFiAPMode;
}

inline bool ConnectivityManagerImpl::_IsWiFiAPActive(void)
{
return mWiFiAPState == kWiFiAPState_Active;
}

inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiAPIdleTimeout(void)
{
return mWiFiAPIdleTimeout;
}

inline bool ConnectivityManagerImpl::_IsWiFiAPApplicationControlled(void)
{
return mWiFiAPMode == kWiFiAPMode_ApplicationControlled;
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP

inline bool ConnectivityManagerImpl::_CanStartWiFiScan()
{
return mWiFiStationState != kWiFiStationState_Connecting;
Expand Down
Loading

0 comments on commit ffb52a1

Please sign in to comment.