mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 16:17:47 +00:00
[posix] add radio url (#4935)
Radio url provides a unified interface for users to specify the radio peripheral device and arguments to the OpenThread core stack.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
spawn $env(OT_COMMAND) $env(RCP_COMMAND) 1
|
||||
spawn $env(OT_COMMAND) "spinel+hdlc+uart://$env(RCP_COMMAND)?arg=1"
|
||||
set timeout 1
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#
|
||||
|
||||
# allows 11-25 and forbidden 26
|
||||
spawn $env(OT_COMMAND) --max-power-table 11,12,13,14,15,16,17,18,19,20,21,22,23,24,-1,0x7f $env(RCP_COMMAND) 1
|
||||
spawn $env(OT_COMMAND) "spinel+hdlc+uart://$env(RCP_COMMAND)?max-power-table=11,12,13,14,15,16,17,18,19,20,21,22,23,24,-1,0x7f&arg=1"
|
||||
set timeout 1
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
@@ -42,7 +42,7 @@ expect "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
# allows all channels by default
|
||||
spawn $env(OT_COMMAND) $env(RCP_COMMAND) 1
|
||||
spawn $env(OT_COMMAND) "spinel+hdlc+uart://$env(RCP_COMMAND)?arg=1"
|
||||
set timeout 1
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
|
||||
@@ -108,7 +108,8 @@ class Node:
|
||||
cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
|
||||
|
||||
if 'RADIO_DEVICE' in os.environ:
|
||||
cmd += ' -v %s' % os.environ['RADIO_DEVICE']
|
||||
cmd += ' -v spinel+hdlc+uart://%s?arg=%d' % (
|
||||
os.environ['RADIO_DEVICE'], nodeid)
|
||||
|
||||
# Load Thread 1.1 node when testing Thread 1.2 scenarios for interoperability
|
||||
elif self.version == '1.1':
|
||||
@@ -120,7 +121,8 @@ class Node:
|
||||
cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
|
||||
|
||||
if 'RADIO_DEVICE_1_1' in os.environ:
|
||||
cmd += ' -v %s' % os.environ['RADIO_DEVICE_1_1']
|
||||
cmd += ' -v spinel+hdlc+uart://%s?arg=%d' % (
|
||||
os.environ['RADIO_DEVICE_1_1'], nodeid)
|
||||
|
||||
cmd += ' %d' % nodeid
|
||||
print("%s" % cmd)
|
||||
@@ -146,7 +148,8 @@ class Node:
|
||||
# If Thread version of node matches the testing environment version.
|
||||
if self.version == self.env_version:
|
||||
if 'RADIO_DEVICE' in os.environ:
|
||||
args = ' %s' % os.environ['RADIO_DEVICE']
|
||||
args = ' spinel+hdlc+uart://%s?arg=%d' % (
|
||||
os.environ['RADIO_DEVICE'], nodeid)
|
||||
else:
|
||||
args = ''
|
||||
|
||||
@@ -184,7 +187,8 @@ class Node:
|
||||
# Load Thread 1.1 node when testing Thread 1.2 scenarios for interoperability.
|
||||
elif self.version == '1.1':
|
||||
if 'RADIO_DEVICE_1_1' in os.environ:
|
||||
args = ' %s' % os.environ['RADIO_DEVICE_1_1']
|
||||
args = ' spinel+hdlc+uart://%s?arg=%d' % (
|
||||
os.environ['RADIO_DEVICE_1_1'], nodeid)
|
||||
else:
|
||||
args = ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user