Skip to content

Commit

Permalink
[Infineon] Fix for successorexit return error for PSoC6 platform (#26042
Browse files Browse the repository at this point in the history
)
  • Loading branch information
praveenCY authored and pull[bot] committed Apr 16, 2024
1 parent 7abb955 commit 4695011
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/platform/Infineon/PSOC6/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,13 @@ CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void)
{
cy_wcm_associated_ap_info_t ap_info;
cy_rslt_t result = CY_RSLT_SUCCESS;
CHIP_ERROR err = CHIP_NO_ERROR;

result = cy_wcm_get_associated_ap_info(&ap_info);
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}

ChipLogProgress(DeviceLayer,
Expand All @@ -193,7 +194,7 @@ CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void)
ap_info.BSSID[0], ap_info.BSSID[1], ap_info.BSSID[2], ap_info.BSSID[3], ap_info.BSSID[4], ap_info.BSSID[5],
ap_info.signal_strength, ap_info.channel, ap_info.channel_width);
exit:
return CHIP_NO_ERROR;
return err;
}

// ==================== ConnectivityManager Platform Internal Methods ====================
Expand Down
14 changes: 7 additions & 7 deletions src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & value)
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
memcpy(mWiFiMacAddress, ap_info.BSSID, CY_WCM_MAC_ADDR_LEN);
value = ByteSpan(mWiFiMacAddress, CY_WCM_MAC_ADDR_LEN);
Expand All @@ -214,7 +214,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
if (ap_info.security == CY_WCM_SECURITY_OPEN)
{
Expand Down Expand Up @@ -289,7 +289,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNu
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
channelNumber = ap_info.channel;

Expand All @@ -307,7 +307,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi)
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
rssi = ap_info.signal_strength;

Expand Down Expand Up @@ -350,7 +350,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiCurrentMaxRate(uint64_t & currentM
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_wlan_statistics failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
count = stats.tx_bitrate * PHYRATE_KPBS_BYTES_PER_SEC;
currentMaxRate = static_cast<uint32_t>(count);
Expand Down Expand Up @@ -394,7 +394,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastRxCount(uint32_t & pa
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_wlan_statistics failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}
count = stats.rx_packets;
count -= mPacketUnicastRxCount;
Expand All @@ -417,7 +417,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiPacketUnicastTxCount(uint32_t & pa
if (result != CY_RSLT_SUCCESS)
{
ChipLogError(DeviceLayer, "cy_wcm_get_wlan_statistics failed: %d", (int) result);
SuccessOrExit(CHIP_ERROR_INTERNAL);
SuccessOrExit(err = CHIP_ERROR_INTERNAL);
}

count = stats.tx_packets;
Expand Down

0 comments on commit 4695011

Please sign in to comment.