[mac filter] add rssfilter support and integrate whitelist/blacklist to AddressFilter (#1967)

* [mac filter] add rssfilter support and integrate whitelist/blacklist
- provide RssIn filter function to fix the received signal strength for test purpose.
- provide Address filter function which integrates whitelist and blacklist, save (~300B) RAM.
- update cli and spinel-cli to reflect new otLinkFilterX() APIs.
- keep whitelist/blacklist spinel properties the same as before while implemented with new otLinkFilterX() APIs.
- THCI: add setOutBoundLinkQuality() API for DEV-1530
- THCI: update Allow/Block relative APIs
- update some test scripts due to new OT_ERROR_ALEADY when adding duplicate address to whitelist

* update for comments

* add MAC_FIXED_RSS spinel property

* rebase and apply new OutboundFrameBegin(aHeader)

* update OpenThread.py
This commit is contained in:
rongli
2017-07-11 22:38:49 -07:00
committed by Jonathan Hui
parent 16d76db592
commit 502c6ca5d6
50 changed files with 2411 additions and 2106 deletions
@@ -45,7 +45,6 @@ class Cert_5_2_4_REEDUpgrade(unittest.TestCase):
self.nodes[LEADER].set_panid(0xface)
self.nodes[LEADER].set_mode('rsdn')
self.nodes[LEADER].add_whitelist(self.nodes[ROUTER].get_addr64())
self.nodes[LEADER].enable_whitelist()
for i in range(2,17):
@@ -78,7 +78,6 @@ class Cert_6_5_2_ChildResetReattach(unittest.TestCase):
time.sleep(5)
self.nodes[LEADER].add_whitelist(self.nodes[ED].get_addr64())
self.nodes[ED].add_whitelist(self.nodes[LEADER].get_addr64())
time.sleep(5)
self.assertEqual(self.nodes[ED].get_state(), 'child')
+11 -5
View File
@@ -150,26 +150,31 @@ class otCli:
self.pexpect.expect('Done')
def clear_whitelist(self):
self.send_command('whitelist clear')
cmd = 'macfilter addr clear'
self.send_command(cmd)
self.pexpect.expect('Done')
def enable_whitelist(self):
self.send_command('whitelist enable')
cmd = 'macfilter addr whitelist'
self.send_command(cmd)
self.pexpect.expect('Done')
def disable_whitelist(self):
self.send_command('whitelist disable')
cmd = 'macfilter addr disable'
self.send_command(cmd)
self.pexpect.expect('Done')
def add_whitelist(self, addr, rssi=None):
cmd = 'whitelist add ' + addr
cmd = 'macfilter addr add ' + addr
if rssi != None:
cmd += ' ' + str(rssi)
self.send_command(cmd)
self.pexpect.expect('Done')
def remove_whitelist(self, addr):
cmd = 'whitelist remove ' + addr
cmd = 'macfilter addr remove ' + addr
self.send_command(cmd)
self.pexpect.expect('Done')
@@ -186,6 +191,7 @@ class otCli:
i = self.pexpect.expect('([0-9a-fA-F]{16})')
if i == 0:
addr64 = self.pexpect.match.groups()[0].decode("utf-8")
self.pexpect.expect('Done')
return addr64