Skip to content

Commit

Permalink
[ESP32] Correct Wi-Fi Network Diagnostics data
Browse files Browse the repository at this point in the history
Fixed the bssid attribute value, it was reported as zero.

Return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE instead of zero for
unsupported attributes.
  • Loading branch information
shubhamdp committed Jan 16, 2022
1 parent fd218ae commit c612def
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
23 changes: 8 additions & 15 deletions src/platform/ESP32/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId)
{
wifi_ap_record_t ap_info;
esp_err_t err;
uint8_t macAddress[kMaxHardwareAddrSize];
static uint8_t macAddress[kMaxHardwareAddrSize];

err = esp_wifi_sta_get_ap_info(&ap_info);
if (err == ESP_OK)
Expand Down Expand Up @@ -314,44 +314,37 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconLostCount(uint32_t & beaconLostCount)
{
beaconLostCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiCurrentMaxRate(uint64_t & currentMaxRate)
{
currentMaxRate = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastRxCount(uint32_t & packetMulticastRxCount)
{
packetMulticastRxCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount)
{
packetMulticastTxCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastRxCount)
{
packetUnicastRxCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastTxCount(uint32_t & packetUnicastTxCount)
{
packetUnicastTxCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiOverrunCount(uint64_t & overrunCount)
{
overrunCount = 0;
return CHIP_NO_ERROR;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts()
Expand Down
2 changes: 1 addition & 1 deletion src/platform/ESP32/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace chip {
namespace DeviceLayer {

/**
* Concrete implementation of the PlatformManager singleton object for Linux platforms.
* Concrete implementation of the PlatformManager singleton object for ESP32 platforms.
*/
class DiagnosticDataProviderImpl : public DiagnosticDataProvider
{
Expand Down

0 comments on commit c612def

Please sign in to comment.