[posix] radio only host side driver (#2690)

This commit is contained in:
Yakun Xu
2018-06-25 16:32:32 -07:00
committed by Jonathan Hui
parent 17eace65e2
commit 1b14a36a35
42 changed files with 5842 additions and 32 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ DIST_SUBDIRS = \
SUBDIRS = \
$(NULL)
if OPENTHREAD_EXAMPLES_POSIX
if OPENTHREAD_POSIX
if OPENTHREAD_ENABLE_CLI
SUBDIRS += \
thread-cert \
+18 -6
View File
@@ -59,13 +59,17 @@ class otCli:
def __init_sim(self, nodeid, mode):
""" Initialize a simulation node. """
if "OT_CLI_PATH" in os.environ.keys():
if 'OT_CLI_PATH' in os.environ.keys():
cmd = os.environ['OT_CLI_PATH']
elif "top_builddir" in os.environ.keys():
elif 'top_builddir' in os.environ.keys():
srcdir = os.environ['top_builddir']
cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
else:
cmd = './ot-cli-%s' % mode
if 'RADIO_DEVICE' in os.environ:
cmd += ' %s' % os.environ['RADIO_DEVICE']
cmd += ' %d' % nodeid
print ("%s" % cmd)
@@ -77,11 +81,18 @@ class otCli:
def __init_ncp_sim(self, nodeid, mode):
""" Initialize an NCP simulation node. """
if "top_builddir" in os.environ.keys():
builddir = os.environ['top_builddir']
cmd = 'spinel-cli.py -p %s/examples/apps/ncp/ot-ncp-%s -n' % (builddir, mode)
if 'RADIO_DEVICE' in os.environ:
args = ' %s' % os.environ['RADIO_DEVICE']
else:
cmd = './ot-ncp-%s' % mode
args = ''
if 'OT_NCP_PATH' in os.environ.keys():
cmd = 'spinel-cli.py -p "%s%s" -n' % (os.environ['OT_NCP_PATH'], args)
elif "top_builddir" in os.environ.keys():
builddir = os.environ['top_builddir']
cmd = 'spinel-cli.py -p "%s/examples/apps/ncp/ot-ncp-%s%s" -n' % (builddir, mode, args)
else:
cmd = 'spinel-cli.py -p "./ot-ncp-%s%s" -n' % (mode, args)
cmd += ' %d' % nodeid
print ("%s" % cmd)
@@ -106,6 +117,7 @@ class otCli:
def send_command(self, cmd):
print("%d: %s" % (self.nodeid, cmd))
self.pexpect.send(cmd + '\n')
sys.stdout.flush()
if isinstance(self.simulator, simulator.VirtualTime):
self.simulator.receive_events()