Esempio n. 1
0
def mav_test(testlog=None):
    '''connect to test board'''
    logger.info("CONNECTING TO TEST BOARD")
    logfile = logger.new_tlog("TestBoard")
#    cmd = "strace -f -ttT -s 200 -o %s.trace mavproxy.py --master %s --out 127.0.0.1:14551 --logfile %s" % (logfile, USB_DEV_TEST, logfile)
    cmd = "mavproxy.py --master %s --out 127.0.0.1:14551 --logfile %s" % (USB_DEV_TEST, logfile)
    if REMOTE_MONITOR['test']:
        cmd += " --out %s" % REMOTE_MONITOR['test']
    return pexpect.spawn(cmd, logfile=testlog, timeout=10)
Esempio n. 2
0
def mav_reference(reflog=None, extra_args=None):
    '''connect to reference board'''
    logger.info("CONNECTING TO REFERENCE BOARD")
    logfile = logger.new_tlog("RefBoard")
    cmd = "mavproxy.py --master %s --out 127.0.0.1:14550 --logfile %s" % (USB_DEV_REFERENCE, logfile)
    if REMOTE_MONITOR['ref']:
        cmd += " --out %s" % REMOTE_MONITOR['ref']
    if extra_args:
        cmd += " %s" % extra_args
    return pexpect.spawn(cmd, logfile=reflog, timeout=10)
Esempio n. 3
0
def nsh_console(interactive=False):
    '''connect to nsh on test board'''
    logger.info("CONNECTING TO NSH CONSOLE")
    if interactive:
        logfile = None
    else:
        logfile = logger.new_tlog("TestNSH", extension='log')
        logger.info("nsh logging to %s" % logfile)
    cmd = "mavproxy.py --baudrate 57600 --setup --master %s" % FMU_DEBUG
    if logfile is not None:
        cmd += " --logfile %s" % logfile
    ret = pexpect.spawn(cmd, logfile=open("/dev/null", 'w'), timeout=30)
    ret.send('\r\n')
    return ret