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

[Infineon] Fix for successorexit return error for PSoC6 platform #26042

Merged
Merged
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
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);
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
}

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