Skip to content

Commit

Permalink
Fix CASE session break for not fully implemented timers (FreeRTOS) (#…
Browse files Browse the repository at this point in the history
…13540)

Error catch on timer broadened to also allow NOT_SYNCED or other errors.
  • Loading branch information
tima-q authored and pull[bot] committed Jan 20, 2024
1 parent d9f8dd3 commit a50fbb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocols/secure_channel/CASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,15 +1317,15 @@ CHIP_ERROR CASESession::SetEffectiveTime()
{
System::Clock::Milliseconds64 currentTimeMS;
CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(currentTimeMS);
if (err == CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE)

if (err != CHIP_NO_ERROR)
{
ChipLogError(
SecureChannel,
"The device does not support GetClock_RealTimeMS() API. This will eventually result in CASE session setup failures.");
// TODO: Remove use of hardcoded time during CASE setup
return GetHardcodedTime();
}
ReturnErrorOnFailure(err);

System::Clock::Seconds32 currentTime = std::chrono::duration_cast<System::Clock::Seconds32>(currentTimeMS);
VerifyOrReturnError(UnixEpochToChipEpochTime(currentTime.count(), mValidContext.mEffectiveTime), CHIP_ERROR_INVALID_TIME);
Expand Down

0 comments on commit a50fbb3

Please sign in to comment.