From 6b4f8a8829197b18000db12ac2c561c940c0875f Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Wed, 29 May 2019 02:50:02 +0800 Subject: [PATCH] [mac] keep the second energy scan sample (#3871) This commit fixes an issue where the second sample is skipped because the timer had not expired yet. --- src/core/mac/sub_mac.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index 350206acf..4666c55ae 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -421,8 +421,7 @@ otError SubMac::EnergyScan(uint8_t aScanChannel, uint16_t aScanDuration) SetState(kStateEnergyScan); mEnergyScanMaxRssi = kInvalidRssiValue; mEnergyScanEndTime = TimerMilli::GetNow() + aScanDuration; - mTimer.Start(kEnergyScanRssiSampleInterval); - SampleRssi(); + mTimer.Start(0); } else {