Lines Matching +full:thread +full:- +full:border +full:- +full:router

29 >> Thread Host Controller Interface
88 LOGX = re.compile(r'((\[(-|C|W|N|I|D)\])'
89 … r'|(-+$)' # e.x. ------------------------------------------------------------------------
95 assert LOGX.match('[-]')
101 assert LOGX.match('------------------------------------------------------------------------')
108 logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
131 _callStackDepth -= 1
196 DOMAIN_NAME = 'Thread'
213 Thread_Device_Role.Router: 'rdn',
214 Thread_Device_Role.SED: '-',
219 Thread_Device_Role.SSED: '-',
391 # print('%s - %s - %s' % (self.port, time.strftime('%b %d %H:%M:%S'), msg))
445 # Make this class compatible with Thread reference 20200818
486 `Param9` should be a JSON string encoded in URL-safe base64 encoding.
489- "cmd-start-otbr-agent" : The command to start otbr-agent (default: systemctl start otbr-agent)
490- "cmd-stop-otbr-agent" : The command to stop otbr-agent (default: systemctl stop otbr-agent)
491- "cmd-restart-otbr-agent" : The command to restart otbr-agent (default: systemctl restart otbr-ag…
492 - "cmd-restart-radvd" : The command to restart radvd (default: service radvd restart)
496 "cmd-start-otbr-agent": "service otbr-agent start",
497 "cmd-stop-otbr-agent": "service otbr-agent stop",
498 "cmd-restart-otbr-agent": "service otbr-agent restart",
499 "cmd-restart-radvd": "service radvd stop; service radvd start",
502 :param Param9: A JSON string encoded in URL-safe base64 encoding.
518 """disable router role
524 """set thread device mode:
527 mode: thread device mode
528 r: rx-on-when-idle
530 d: full thread device
538 return self.__executeCommand(cmd)[-1] == 'Done'
541 """set router upgrade threshold
544 iThreshold: the number of active routers on the Thread network
545 partition below which a REED may decide to become a Router.
552 return self.__executeCommand(cmd)[-1] == 'Done'
555 """set router downgrade threshold
558 iThreshold: the number of active routers on the Thread network
559 partition above which an active router may decide to
567 return self.__executeCommand(cmd)[-1] == 'Done'
570 """set ROUTER_SELECTION_JITTER parameter for REED to upgrade to Router
573 iRouterJitter: a random period prior to request Router ID for REED
580 return self.__executeCommand(cmd)[-1] == 'Done'
590 return self.__executeCommand(cmd)[-1] == 'Done'
596 True: successful to start OpenThread stack and thread interface up
620 Thread_Device_Role.Router,
640 self.__executeCommand('thread start')
665 # rloc16 might be hex string or integer, need to return actual allocated router id
667 """mapping Rloc16 to router id
673 actual router id allocated by leader
675 routerList = self.__executeCommand('router list')[0].split()
680 cmd = 'router %s' % index
681 router = self.__executeCommand(cmd)
683 for line in router:
686 elif 'Router ID' in line:
706 # pylint: disable=no-self-use
772 # pylint: disable=no-self-use
793 return self.__executeCommand(cmd)[-1] == 'Done'
801 return self.__executeCommand(cmd)[-1] == 'Done'
814 if self.__executeCommand(cmd)[-1] == 'Done':
824 # pylint: disable=no-self-use
829 string (str): UTF-8 input string.
848 """set Thread Network name
854 True: successful to set the Thread Networkname
855 False: fail to set the Thread Networkname
861 …return self.__executeCommand(cmd)[-1] == 'Done' and self.__executeCommand(datasetCmd)[-1] == 'Done'
865 """set channel of Thread device operates on.
869 (0 - 10: Reserved)
870 (11 - 26: 2.4GHz channels)
871 (27 - 65535: Reserved)
881 …return self.__executeCommand(cmd)[-1] == 'Done' and self.__executeCommand(datasetCmd)[-1] == 'Done'
890 """set the extended address of Thread device
905 if self.__executeCommand(cmd)[-1] == 'Done':
950 """get router locator unicast Ipv6 address"""
980 """set Thread network key
983 key: Thread network key used in secure the MLE/802.15.4 packet
986 True: successful to set the Thread network key
987 False: fail to set the Thread network key
1002 …return self.__executeCommand(cmd)[-1] == 'Done' and self.__executeCommand(datasetCmd)[-1] == 'Done'
1030 ret = self.__executeCommand(cmd)[-1] == 'Done'
1060 ret = self.__executeCommand(cmd)[-1] == 'Done'
1086 if self.__executeCommand(cmd)[-1] == 'Done':
1109 if self.__executeCommand(cmd)[-1] == 'Done':
1116 """get current device role in Thread Network"""
1121 """make device ready to join the Thread Network with a given role
1127 True: ready to set Thread Network parameter for joining desired Network
1130 mode = '-'
1142 elif eRoleId == Thread_Device_Role.Router:
1143 print('join as router')
1156 mode = '-'
1160 mode = '-'
1176 # always remain an ED, never request to be a router
1185 mode = 's' if mode == '-' else mode + 's'
1187 # set Thread device mode with a given role
1214 if expected_role == Thread_Device_Role.Router:
1217 if self.getDeviceRole() == "router":
1221 … raise AssertionError("OT Router {} could not attach to the network after {} s of timeout.".format(
1233 """get current partition id of Thread Network Partition from LeaderData
1236 The Thread network Partition Id
1246 """get Thread device's parent extended address and rloc16 short address
1266 """power down the Thread device"""
1271 """power up the Thread device"""
1306 """reset and rejoin to Thread Network without any timeout
1309 True: successful to reset and rejoin the Thread Network
1310 False: fail to reset and rejoin the Thread Network
1318 """reset and join back Thread Network with a given timeout delay
1321 timeout: a timeout interval before rejoin Thread Network
1324 True: successful to reset and rejoin Thread Network
1325 False: fail to reset and rejoin the Thread Network
1367 """set Thread Network PAN ID
1373 True: successful to set the Thread Network PAN ID
1374 False: fail to set the Thread Network PAN ID
1383 …return self.__executeCommand(cmd)[-1] == 'Done' and self.__executeCommand(datasetCmd)[-1] == 'Done'
1419 """kickoff router with a given router id from the Thread Network
1422 xRouterId: a given router id in hex format
1425 True: successful to remove the router from the Thread Network
1426 False: fail to remove the router from the Thread Network
1434 return self.__executeCommand(cmd)[-1] == 'Done'
1438 """set default mandatory Thread Network parameter value"""
1463 # indicate Thread device requests full or stable network data
1465 # indicate if Thread device experiences a power down event
1470 # indicate if Thread device is an active commissioner
1545 return self.__executeCommand(cmd)[-1] == 'Done'
1555 3: 21 - 255 (dB)
1556 2: 11 - 20 (dB)
1557 1: 3 - 9 (dB)
1558 0: 0 - 2 (dB)
1576 cmd = 'macfilter rss add-lqi %s %s' % (address64, str(LinkQuality))
1577 return self.__executeCommand(cmd)[-1] == 'Done'
1586 3: 21 - 255 (dB)
1587 2: 11 - 20 (dB)
1588 1: 3 - 9 (dB)
1589 0: 0 - 2 (dB)
1595 cmd = 'macfilter rss add-lqi * %s' % str(LinkQuality)
1596 return self.__executeCommand(cmd)[-1] == 'Done'
1600 """remove the configured prefix on a border router
1603 prefixEntry: a on-mesh prefix entry in IPv6 dotted-quad format
1606 True: successful to remove the prefix entry from border router
1607 False: fail to remove the prefix entry from border router
1611 if self.__executeCommand(cmd)[-1] == 'Done':
1614 return self.__executeCommand(cmd)[-1] == 'Done'
1631 """configure the border router with a given prefix entry parameters
1634 P_Prefix: IPv6 prefix that is available on the Thread Network in IPv6 dotted-quad format
1635 P_stable: true if the default router is expected to be stable network data
1636 P_default: true if border router offers the default route for P_Prefix
1637 P_slaac_preferred: true if allowing auto-configure address using P_Prefix
1638 P_Dhcp: is true if border router is a DHCPv6 Agent
1639 P_preference: is two-bit signed integer indicating router preference
1640 P_on_mesh: is true if P_Prefix is considered to be on-mesh
1641 P_nd_dns: is true if border router is able to supply DNS information obtained via ND
1644 True: successful to configure the border router with a given prefix entry
1645 False: fail to configure the border router with a given prefix entry
1683 elif P_preference == -1:
1689 if self.__executeCommand(cmd)[-1] == 'Done':
1691 # do not send out server data ntf pro-actively
1697 return self.__executeCommand(cmd)[-1] == 'Done'
1733 """set networkid timeout for Thread device
1744 return self.__executeCommand(cmd)[-1] == 'Done'
1758 return self.__executeCommand(cmd)[-1] == 'Done'
1762 """ set the Key sequence counter corresponding to Thread network key
1775 if self.__executeCommand(cmd)[-1] == 'Done':
1783 """get current Thread Network key sequence"""
1806 """set whether the Thread device requires the full network data
1821 """configure border router with a given external route prefix entry
1824 P_Prefix: IPv6 prefix for the route in IPv6 dotted-quad format
1826 R_Preference: a two-bit signed integer indicating Router preference
1829 -1: low
1832 True: successful to configure the border router with a given external route prefix
1833 False: fail to configure the border router with a given external route prefix
1842 elif R_Preference == -1:
1853 if self.__executeCommand(cmd)[-1] == 'Done':
1856 return self.__executeCommand(cmd)[-1] == 'Done'
1866 routerList = self.__executeCommand('router list')[0].split()
1872 router = []
1873 cmd = 'router %s' % index
1874 router = self.__executeCommand(cmd)
1876 for line in router:
1939 """set extended PAN ID of Thread Network
1960 …return self.__executeCommand(cmd)[-1] == 'Done' and self.__executeCommand(datasetCmd)[-1] == 'Done'
1994 """set Thread Network Partition ID
2005 return self.__executeCommand(cmd)[-1] == 'Done'
2009 """get expected global unicast IPv6 address of Thread device
2034 """get Rloc16 short address of Thread device"""
2039 """get mesh local EID of Thread device"""
2047 return self.__executeCommand(cmd)[-1] == 'Done'
2064 """force to set a slaac IPv6 address to Thread interface
2070 True: successful to set slaac address to Thread interface
2071 False: fail to set slaac address to Thread interface
2074 return self.__executeCommand(cmd)[-1] == 'Done'
2132 return self.__executeCommand(cmd)[-1] == 'Done'
2138 baAddr: A string represents the border agent address.
2139 baPort: An integer represents the border agent port.
2182 if self.__executeCommand(cmd)[-1] == 'Done':
2197 xEUI: Joiner's EUI-64
2222 if self.__executeCommand(cmd)[-1] == 'Done':
2247 return self.__executeCommand(cmd)[-1] == 'Done'
2259 if self.__executeCommand(cmd)[-1] == 'Done':
2282 Thread_Device_Role.Router,
2289 if self.__executeCommand(cmd)[-1] == 'Done':
2306 self.__executeCommand('thread start')
2349 payloadLineCount = (int(infoValue) + bytesInEachLine - 1) / bytesInEachLine
2353 payloadLineCount = payloadLineCount - 1
2400 return self.__executeCommand(cmd)[-1] == 'Done'
2420 return self.__executeCommand(cmd)[-1] == 'Done'
2437 return self.__executeCommand(cmd)[-1] == 'Done'
2455 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2458 return self.__executeCommand(cmd)[-1] == 'Done'
2528 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2620 return self.__executeCommand(cmd)[-1] == 'Done'
2638 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2641 return self.__executeCommand(cmd)[-1] == 'Done'
2701 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2710 return self.__executeCommand(cmd)[-1] == 'Done'
2724 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2727 return self.__executeCommand(cmd)[-1] == 'Done'
2768 cmd += ' ' + self.__replaceCommands['-x'] + ' '
2771 return self.__executeCommand(cmd)[-1] == 'Done'
2777 return self.__executeCommand(cmd)[-1] == 'Done'
2784 return self.__executeCommand(cmd)[-1] == 'Done'
2798 return self.__executeCommand(cmd)[-1] == 'Done'
2809 return self.__executeCommand(cmd)[-1] == 'Done'
2817 """force update to router as if there is child id request"""
2832 cmd = 'state router'
2833 return self.__executeCommand(cmd)[-1] == 'Done'
2843 return self.__executeCommand(cmd)[-1] == 'Done'
2847 assert not self.IsBorderRouter, "Method not expected to be used with border router devices"
2868 MUST NOT set SeqNumInc to True and SeqNum to non-None value at the same time.
2903 ret = self.__executeCommand(cmd)[-1] == 'Done'
2924 return self.__executeCommand(cmd)[-1] == 'Done'
2929 return self.__executeCommand(cmd)[-1] == 'Done'
2939 return self.__executeCommand(cmd)[-1] == 'Done'
2996 return self.__executeCommand(cmd)[-1] == 'Done'
3006 cmd += 'enhanced-ack'
3011 return self.__executeCommand(cmd)[-1] == 'Done'
3016 return self.__executeCommand(cmd)[-1] == 'Done'
3022 return self.__executeCommand(cmd)[-1] == 'Done'
3032 cmd += '-128'
3035 return self.__executeCommand(cmd)[-1] == 'Done'
3041 return self.__executeCommand(cmd)[-1] == 'Done'
3048 assert interface == 0, "non-BR must send UDP to Thread interface"
3051 cmd = 'udp send %s %s -x %s' % (destination, port, payload)
3052 return self.__executeCommand(cmd)[-1] == 'Done'
3070 return self.__executeCommand(cmd)[-1] == 'Done'
3075 return self.__executeCommand(cmd)[-1] == 'Done'
3113 """specify the DUA before Thread Starts."""
3116 iid = ipaddress.IPv6Address(sDua).packed[-8:]
3118 return self.__executeCommand(cmd)[-1] == 'Done'
3124 mliid = mleid[-19:].replace(':', '')
3128 """Set the Mesh Local IID before Thread Starts."""
3140 return self.__executeCommand(cmd)[-1] == 'Done'
3187 """migrate to another Thread Partition 'net_name' (could be None)
3189 after migration for DUA-TC-06/06b (DEV-1923)
3214 return self.__executeCommand(cmd)[-1] == 'Done'
3219 return self.__executeCommand(cmd)[-1] == 'Done'
3238 if self.__executeCommand(ZEPHYR_PREFIX + 'thread version')[0].isdigit():
3244 """Detect if the device is a Thread reference 20200818 """
3246 # Running `version api` in Thread reference 20200818 is equivalent to running `version`
3252 '-x': 'binary',
3270 thver = self.__executeCommand('thread version')[0]