1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-17 23:30:11 -07:00

add support mobilinkd TNC4

This commit is contained in:
KM4ACK 2023-03-04 07:13:43 -06:00
parent 5bae86b331
commit eaca30fdca

View File

@ -2,7 +2,7 @@
#script to connect mobilinkd TNC for ax25 #script to connect mobilinkd TNC for ax25
#20200602 #20200602
#20220304 last edit KM4ACK #20230304 last edit KM4ACK
################################################################ ################################################################
# # # #
# # # # # # # ##### # # # # # # # # # # ##### # # #
@ -75,26 +75,28 @@ Another notice will appear once a connection to the device is established." &
#scan for bluetooth device and write to file #scan for bluetooth device and write to file
hcitool scan > $TMPFILE hcitool scan > $TMPFILE
#Decide if its a TNC 2 or 3 #Decide if its a TNC 2, 3, or 4
TNC2=$(grep -i TNC2 $TMPFILE) TNC2=$(grep -i TNC2 $TMPFILE)
TNC3=$(grep -i TNC3 $TMPFILE) TNC3=$(grep -i TNC3 $TMPFILE)
if [ -z "$TNC2" ] TNC4=$(grep -i TNC4 $TMPFILE)
then if [ -n "$TNC2" ]; then
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
TNC=3
elif [ -z "$TNC3" ]
then
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }') MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
TNC=2 TNC=2
elif [ -n "$TNC3" ]; then
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
TNC=3
elif [ -n "$TNC4" ]; then
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
TNC=4
fi fi
#set correct connection commmand #set correct connection commmand
if [ $TNC = "2" ] if [ $TNC = "2" ]; then
then
CONNECT="sudo -A rfcomm bind /dev/rfcomm0 $MAC" CONNECT="sudo -A rfcomm bind /dev/rfcomm0 $MAC"
elif [ $TNC = "3" ] elif [ $TNC = "3" ]; then
then
CONNECT="sudo -A rfcomm bind /dev/rfcomm0 $MAC 6" CONNECT="sudo -A rfcomm bind /dev/rfcomm0 $MAC 6"
elif [ $TNC = "4" ]; then
CONNECT="sudo -A rfcomm bind /dev/rfcomm0 $MAC"
fi fi
#See if device was found and connect if found #See if device was found and connect if found