mirror of
https://github.com/espressif/openthread.git
synced 2026-10-14 03:37:40 +00:00
[mle] let the command partitionid return the current partition id (#5872)
If user doesn't set the Partition Id using the command 'leaderpartitionid xxx', the current cli command 'leaderpartitionid' always return 0. This commit renames the command 'leaderpartitionid' to partitionid and let the command partitionid returns the current leader Partition Id and add command partitionid preferred to set or get preferred Partition Id.
This commit is contained in:
@@ -114,7 +114,7 @@ class Cert_5_5_3_SplitMergeChildren(thread_cert.TestCase):
|
||||
|
||||
self.nodes[LEADER].reset()
|
||||
self._setUpLeader()
|
||||
self.nodes[ROUTER2].set_partition_id(0xffffffff)
|
||||
self.nodes[ROUTER2].set_preferred_partition_id(0xffffffff)
|
||||
|
||||
self.simulator.go(140)
|
||||
|
||||
|
||||
@@ -939,12 +939,12 @@ class NodeImpl:
|
||||
self.send_command(cmd)
|
||||
self._expect('Done')
|
||||
|
||||
def get_partition_id(self):
|
||||
self.send_command('leaderpartitionid')
|
||||
def get_preferred_partition_id(self):
|
||||
self.send_command('partitionid preferred')
|
||||
return self._expect_result(r'\d+')
|
||||
|
||||
def set_partition_id(self, partition_id):
|
||||
cmd = 'leaderpartitionid %d' % partition_id
|
||||
def set_preferred_partition_id(self, partition_id):
|
||||
cmd = 'partitionid preferred %d' % partition_id
|
||||
self.send_command(cmd)
|
||||
self._expect('Done')
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ class TestCase(NcpSupportMixin, unittest.TestCase):
|
||||
self.nodes[i].set_mode(params['mode'])
|
||||
|
||||
if 'partition_id' in params:
|
||||
self.nodes[i].set_partition_id(params['partition_id'])
|
||||
self.nodes[i].set_preferred_partition_id(params['partition_id'])
|
||||
if 'channel' in params:
|
||||
self.nodes[i].set_channel(params['channel'])
|
||||
if 'masterkey' in params:
|
||||
|
||||
Reference in New Issue
Block a user