3 if [ -x /usr/bin/ao-flash-stm ]; then
4 FLASH_STM=/usr/bin/ao-flash-stm
6 echo "Can't find ao-flash-stm! Aborting."
10 if [ -x /usr/bin/ao-usbload ]; then
11 USBLOAD=/usr/bin/ao-usbload
13 echo "Can't find ao-usbload! Aborting."
18 REPO=~/altusmetrumllc/Binaries
20 echo "TeleBT v$VERSION Turn-On and Calibration Program"
21 echo "Copyright 2015 by Bdale Garbee. Released under GPL v2"
24 echo "\tTeleBT v$VERSION powered from USB"
25 echo "\t\twith ST-Link-V2 cabled to debug header"
26 echo "\t\twith coax from UHF to frequency counter"
28 echo -n "TeleBT-$VERSION serial number: "
33 $FLASH_STM $REPO/loaders/telebt-v$VERSION*.elf || exit 1
37 $USBLOAD --serial=$SERIAL $REPO/telebt-v$VERSION*.elf || exit 1
41 dev=`ao-list | awk '/TeleBT-v'"$VERSION"'/ { print $3; exit(0); }'`
45 echo "TeleBT found on $dev"
48 echo 'No TeleBT-v'"$VERSION"' found'
55 SERIAL=$SERIAL ./cal-freq $dev
59 echo -n "checking BlueTooth functionality... "
60 btdev=`hcitool scan | awk -F \- '/TeleBT/ { print $2 }'`
61 if [ "$btdev" = "$SERIAL" ]; then
64 echo "device not found"
68 echo "TeleBT-v$VERSION $SERIAL is ready to ship"