mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 09:07:47 +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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user