From 5eb0537cf0f1ef6076b6a22d2319a65b6c4ed249 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Thu, 7 Apr 2022 20:46:06 +0200 Subject: [PATCH] [thci] increase BBR Sequence Number when dataset changes (#7558) Make sure BBR Sequence Number is increased when Re-registration Delay or MLR Timeout changes. --- tools/harness-thci/OpenThread.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/harness-thci/OpenThread.py b/tools/harness-thci/OpenThread.py index 84453850e..f2556cad8 100644 --- a/tools/harness-thci/OpenThread.py +++ b/tools/harness-thci/OpenThread.py @@ -2963,6 +2963,11 @@ class OpenThreadTHCI(object): False: fail to set BBR Dataset """ assert not (SeqNumInc and SeqNum is not None), "Must not specify both SeqNumInc and SeqNum" + + if (MlrTimeout and MlrTimeout != self.bbrMlrTimeout) or (ReRegDelay and ReRegDelay != self.bbrReRegDelay): + if SeqNum is None: + SeqNumInc = True + if SeqNumInc: if self.bbrSeqNum in (126, 127): self.bbrSeqNum = 0 @@ -2970,6 +2975,8 @@ class OpenThreadTHCI(object): self.bbrSeqNum = 128 else: self.bbrSeqNum = (self.bbrSeqNum + 1) % 256 + else: + self.bbrSeqNum = SeqNum return self.__configBbrDataset(SeqNum=self.bbrSeqNum, MlrTimeout=MlrTimeout, ReRegDelay=ReRegDelay) @@ -3256,7 +3263,7 @@ class OpenThreadTHCI(object): @API def setMLRtimeout(self, iMsecs): """Setup BBR MLR Timeout to `iMsecs` seconds.""" - self.__configBbrDataset(MlrTimeout=iMsecs) + self.setBbrDataset(MlrTimeout=iMsecs) @API def stopListeningToAddr(self, sAddr):