deal with cheap BT dongle that shows multiple copies of unit in lescan output
authorBdale Garbee <bdale@gag.com>
Thu, 14 Sep 2017 16:51:18 +0000 (10:51 -0600)
committerBdale Garbee <bdale@gag.com>
Thu, 14 Sep 2017 16:51:18 +0000 (10:51 -0600)
ao-bringup/turnon_telebt

index 912ba459657d01bdb5a889d00d4eba2f4613d7f2..fb8318b311c83d7ac28aa9adfbe392cf866ef1af 100755 (executable)
@@ -80,7 +80,7 @@ else
 fi
 
 echo -n "checking BTLE functionality... "
-btdev=`sudo timeout -s SIGINT 5s hcitool lescan | awk -F \- '/TeleBT/ { print $2 }'`
+btdev=`sudo timeout -s SIGINT 5s hcitool lescan | awk -F \- '/TeleBT/ { print $2 }' | head -n 1`
 if [ "$btdev" = "$SERIAL" ]; then
        echo "working!"
 else