bin/microspec_emulator.py

Example Usage

Note

You probably never need to run this, unless you really need to turn on debugging trace on the emulator in order to see what you’re sending to it. Usually, specifying emulator=True is enough to use the emulator, in the simple and expert API.

Also, this will only work on Mac OSX and Linux systems, not on Windows.

Longwinded example

dir=`mktemp -d`

socat PTY,raw,echo=0,link=$dir/microspec.software PTY,raw,echo=0,link=$dir/microspec.hardware &

microspec_emulator.py -f $dir/microspec.hardware

# Then connect interface to $dir/microspec.software file

# And stop the socat background command, and clean up the $dir and it’s contents

Short example

microspec_emulator.py -s -p

# Then connect interface to filename that the script prints to stdout


Command-line arguments

Optional arguments

Argument

Description

-h, --help

show this help message and exit

-v, --verbose

Print verbose trace

-d, --debug

Internal debugging

-p, --print

Print socket to connect to

-t  TIMEOUT, --timeout  TIMEOUT

Timeout in (partial float) seconds

-s, --spawn

Spawn socat instance?

-f  FILE, --file  FILE

File to use as a pipe - default create anew and print location


Script contents

bin.microspec_emulator.main()