Skip to content

Commit

Permalink
[ESP32] Updating country in phy layer is only supported on wifi SoCs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamdp authored and pull[bot] committed Aug 18, 2023
1 parent ce06694 commit 1019728
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/platform/ESP32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,13 @@ CHIP_ERROR ConfigurationManagerImpl::StoreCountryCode(const char * code, size_t
{
// As per spec, codeLen has to be 2
VerifyOrReturnError((code != nullptr) && (codeLen == 2), CHIP_ERROR_INVALID_ARGUMENT);

// Setting country is only possible on WiFi supported SoCs
#if CONFIG_ESP32_WIFI_ENABLED
// Write CountryCode to esp_phy layer
ReturnErrorOnFailure(MapConfigError(esp_phy_update_country_info(code)));
#endif

// As we do not have API to read country code from esp_phy layer, we are writing to NVS and when client reads the
// CountryCode then we read from NVS
return GenericConfigurationManagerImpl<ESP32Config>::StoreCountryCode(code, codeLen);
Expand Down

0 comments on commit 1019728

Please sign in to comment.