mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 17:17:45 +00:00
[time-sync] fix incorrect status after boot (#3291)
This commit is contained in:
committed by
Jonathan Hui
parent
9f7bc3a6ec
commit
7d36e8d913
@@ -195,7 +195,12 @@ void TimeSync::CheckAndHandleChanges(bool aTimeUpdated)
|
||||
|
||||
case OT_DEVICE_ROLE_CHILD:
|
||||
case OT_DEVICE_ROLE_ROUTER:
|
||||
if (timeSyncLastSyncMs > resyncNeededThresholdMs)
|
||||
if (mLastTimeSyncReceived == 0)
|
||||
{
|
||||
// Haven't yet received any time sync
|
||||
networkTimeStatus = OT_NETWORK_TIME_UNSYNCHRONIZED;
|
||||
}
|
||||
else if (timeSyncLastSyncMs > resyncNeededThresholdMs)
|
||||
{
|
||||
// The device hasn’t received time sync for more than two periods time.
|
||||
networkTimeStatus = OT_NETWORK_TIME_RESYNC_NEEDED;
|
||||
|
||||
Reference in New Issue
Block a user