OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Tree!explorer Obex Gui For Send-to Function
bam
post Dec 27 2006, 10:08 PM
Post #1





Group: Members
Posts: 1,213
Joined: 9-June 05
From: Gobi Desert, Mongolia
Member No.: 7,306



modified Meanies bluetooth-gui script to work for Tree!Exploreer Plus Send-To functionality

#!/bin/sh
#
######################################################################
APPNAME="OBEX GUI"
BNAME=`basename $0`
BLUECONTROL=/etc/pcmcia/bluetooth
BTLIST=/etc/bluetooth/devices
BTDEV=/etc/bluetooth/device
SUDO=`which sudo`

sFile=$1

init()
{
export QSHDLG_APP=$BNAME$1
INPUT=/var/spool/qshdlg/input_${QSHDLG_APP}
OUTPUT=/var/spool/qshdlg/output_${QSHDLG_APP}
CONTROL=/var/spool/qshdlg/control_${QSHDLG_APP}
}

get_device()
{
if [ -f $BTDEV ] && [ "$DEVICE" = "" ]; then
DEVICE=`cat $BTDEV`
fi

}


init dc
qshdlg custom -C "message,reply" -A -f lcfont -t "$APPNAME : control" -v "Scan,Start,Stop" &
while [ ! -p $CONTROL ]
do
echo >/dev/null
done
if [ "`hciconfig`" = "" ]; then
echo "Bluetooth service is not started" > $OUTPUT
else
echo "Bluetooth service is running" > $OUTPUT
if [ -f $BTLIST ]; then
for NODE in `grep ':' $BTLIST`
do
if [ "$NODE" != "Scanning" ] && [ "$NODE" != "..." ]; then
if [ "`echo $NODE |grep ':'`" != "" ]; then
NODEADDRESS=$NODE
else
echo 'item(QString)' "$NODEADDRESS---[$NODE]" > $CONTROL
FOUND=1
fi
fi
done
if [ "$FOUND" = "1" ]; then
echo 'showSelect()' > $CONTROL
echo "Please select Bluetooth device" > $OUTPUT
fi
fi
fi
while read RET < $INPUT
do
case $RET in
Start)
if [ "`hciconfig`" != "" ]; then
echo "stopping Bluetooth service..." > $OUTPUT
$SUDO $BLUECONTROL stop
CARDID=`cardctl ident 0 |grep manfid|cut -d: -f2 2>/dev/null`
if [ "$CARDID" != "" ] && [ "`grep $CARDID /etc/pcmcia/bluetooth.conf 2>/dev/null`" != "" ]; then
$SUDO cardctl eject 0
fi
fi
if [ "`cardctl status 0|grep 'no card'`" != "" ]; then
echo "inserting card..." > $OUTPUT
$SUDO cardctl insert 0
fi
if [ "`cardctl status 0|grep suspended`" != "" ]; then
echo "resuming card..." > $OUTPUT
$SUDO cardctl resume 0
fi
echo "starting Bluetooth service..." > $OUTPUT
if [ "`hciconfig`" = "" ]; then
echo "Bluetooth started" > $OUTPUT
$SUDO $BLUECONTROL start
else
echo "Bluetooth failed to start" > $OUTPUT
fi
;;
Stop)
echo "stopping Bluetooth service..." > $OUTPUT
$SUDO $BLUECONTROL stop
CARDID=`cardctl ident 0 |grep manfid|cut -d: -f2 2>/dev/null`
if [ "$CARDID" != "" ] && [ "`grep $CARDID /etc/pcmcia/bluetooth.conf 2>/dev/null`" != "" ]; then
$SUDO cardctl eject 0
fi
if [ "`hciconfig`" = "" ]; then
echo "Bluetooth stopped" > $OUTPUT
else
echo "Bluetooth failed to stop" > $OUTPUT
fi
;;
Scan)
if [ "`hciconfig`" = "" ]; then
echo "Cannot scan. Bluetooth is not enabled." > $OUTPUT
else
echo "Scanning for Bluetooth devices..." > $OUTPUT
FOUND=0
for NODE in `hcitool scan | $SUDO tee $BTLIST`
do
if [ "$NODE" != "Scanning" ] && [ "$NODE" != "..." ]; then
if [ "`echo $NODE |grep ':'`" != "" ]; then
NODEADDRESS=$NODE
else
echo 'item(QString)' "$NODEADDRESS---[$NODE]" > $CONTROL
FOUND=1
fi
fi
done
if [ "$FOUND" = "1" ]; then
echo 'showSelect()' > $CONTROL
echo "Please select Bluetooth device" > $OUTPUT
else
echo "No Bluetooth device found" > $OUTPUT
fi
fi
;;
*)
if [ "`echo $RET|grep ':'`" != "" ]; then
DEVICE=`echo $RET|cut -d- -f1`
echo "selected device is $DEVICE" |tee $OUTPUT

get_device
echo "Connecting to Device..." > $OUTPUT

if [ -f /etc/bluetooth/obex ]; then
OFTP=`cat /etc/bluetooth/obex`
else
OFTP=`sdptool search FTP|grep Channel|cut -d: -f2`
fi

echo 'Connected' > $OUTPUT
echo "transferring $sFile ..." > $OUTPUT
obextool push $sFile $DEVICE $OFTP
echo "Transfer Complete" > $OUTPUT
$SUDO touch $BTDEV
$SUDO chown zaurus:qpe $BTDEV
echo $DEVICE > $BTDEV
else
echo "nothing selected" |tee $OUTPUT
fi

echo 'reject()' > $CONTROL
;;
esac
done


make sure to add a command in Tree!Explorer Plus Send-to
select command, then the name of this script "obex-gui %1 &", no quotes. Then you should be able to liong tap->send to->obex-gui. The dialog box pops-up select the device and press ok. thanks to Meanie for the original bluetooth-gui script.
Go to the top of the page
 
+Quote Post
Jon_J
post Dec 27 2006, 11:50 PM
Post #2





Group: Members
Posts: 1,853
Joined: 31-December 05
From: Illinois USA
Member No.: 8,821



I sure wish I could get my hands on Tree!Explorer+
Anywhere I can send a money order?
I would drop my other filemanagers if I could click and launch documents from Tree!Explorer. smile.gif
Go to the top of the page
 
+Quote Post
bam
post Dec 28 2006, 11:47 AM
Post #3





Group: Members
Posts: 1,213
Joined: 9-June 05
From: Gobi Desert, Mongolia
Member No.: 7,306



I thinki I got it at handango
Go to the top of the page
 
+Quote Post
dougeeebear
post Dec 28 2006, 12:30 PM
Post #4





Group: Members
Posts: 537
Joined: 8-July 04
From: Mid-South, USA
Member No.: 3,959



Jon,
Maybe this will help.

Or you could send me a money order for $50,000,000,000.00 laugh.gif
Go to the top of the page
 
+Quote Post
Jon_J
post Dec 28 2006, 12:39 PM
Post #5





Group: Members
Posts: 1,853
Joined: 31-December 05
From: Illinois USA
Member No.: 8,821



handango link is dead
" Error
The product you were looking for is not available."

I don't think handango will take money orders.
I'll ask Stephen at StreamlineCPUs if he can get it for me when I order my new C3200 next month.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th October 2019 - 10:01 AM