|
|
|
@ -13,15 +13,15 @@ List all currently connected USB to serial adapters by searching through
|
|
|
|
|
|
|
|
|
|
./find-tty.sh [serial_regex1] [serial_regex2] ... [serial_regexZ]
|
|
|
|
|
|
|
|
|
|
Write to `stdout` the first tty connected to the chosen programmer.
|
|
|
|
|
Write to `stdout` all ttys connected to the chosen programmer.
|
|
|
|
|
`serial_regexN` are extended regular expressions (as understood by `egrep`)
|
|
|
|
|
containing a pattern matched against the USB device serial number. Each of the
|
|
|
|
|
given expressions are tested, against each serial number until a match has been
|
|
|
|
|
found.
|
|
|
|
|
given expressions are tested, against each serial number, and matching ttys are
|
|
|
|
|
output (one tty per line).
|
|
|
|
|
|
|
|
|
|
In order to search for an exact match against the device serial, use
|
|
|
|
|
'^serialnumber$' as the pattern. If no pattern is given, `find-tty.sh` returns
|
|
|
|
|
the first found USB tty (in an arbitrary order, this is not guaranteed to be
|
|
|
|
|
all found USB ttys (in an arbitrary order, this is not guaranteed to be
|
|
|
|
|
the `/dev/ttyUSBX` with the lowest number).
|
|
|
|
|
|
|
|
|
|
Serial strings from all connected USB ttys can be found from the list generated
|
|
|
|
@ -45,7 +45,7 @@ solution):
|
|
|
|
|
ifeq ($(PORT),)
|
|
|
|
|
# try to find tty name by serial number, only works on Linux currently.
|
|
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
|
PORT := $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$")
|
|
|
|
|
PORT := $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$"))
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
@ -53,7 +53,7 @@ solution):
|
|
|
|
|
# Fallback PORT if no serial was specified or if the specified serial was not found
|
|
|
|
|
ifeq ($(PORT),)
|
|
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
|
PORT := $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh)
|
|
|
|
|
PORT := $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh))
|
|
|
|
|
else ifeq ($(OS),Darwin)
|
|
|
|
|
PORT := $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
|
|
|
|
|
endif
|
|
|
|
|