[G1 General] stanelie:
So,

I got in touch with the creator of Tether Blu and he tried to cook something up for me. But for lack of time, he had to stop working on it.

It is two folds : a compiled pand for android, and a small script that runs pand and associates it with my windows mobile based bluetooth access point.

A working network is established between the two devices using the bluetooth link, the android phone can even reach the internet using this link. However, somehow, DNS queries do not get relayed, so I can only reach websites or devices using their numeric IP addresses. Also, most applications that use a data connection to the internet check before doing their stuff if a working link is there by querying android about the status of either the cellular data link, or the wifi connection. These applications fail to pass this check because they do not recognize the bluetooth link as a valid link, even though the link works. Remote (a RDP client) is such an app, where even if you try to reach a machine using it's ip address, you can't because the application thinks it is not connected to a network.

So, does anyone know how to correctly assign working DNS entries to Android?

Also, does anyone know how to flag the data link or the wifi link as being "UP" even though they are not really up? This looks like a good way to have all these applications that check whether or not a data link exists to still work using the bluetooth tether.

Here is the code of tether.sh :

#!/system/bin/sh

MACADDRESS="00:17:83:0F:0F:C7"
apath=""
tpath=""
IFS="/"
for i in $0
do
apath="$tpath"
tpath="${tpath}${i}/"
done
IFS="|"

pand_pidfile=${apath}pand.pid
PAND_PID=0
if [ -e $pand_pidfile ]; then
PAND_PID=`cat $pand_pidfile`
if [ "x" = "x$PAND_PID" ]; then
PAND_PID=0
else
if ! (ps | grep ${apath}pand | grep -v grep > /dev/null); then
PAND_PID=0
fi
fi
fi

logfile=${apath}tether-log

case "$1" in
start)

if [ 0 -eq $PAND_PID ]; then
echo "Starting pand"
rm $pand_pidfile > /dev/null 2>&1
PAND_PID=0
rm $logfile > /dev/null 2>&1 # if it exists
${apath}pand --role PANU --connect $MACADDRESS -n --pidfile $pand_pidfile || exit
sleep 1
ifconfig bnep0 up
sleep 2
netcfg bnep0 dhcp
fi
echo "Success"
;;
stop)
if [ 0 -ne $PAND_PID ]; then
echo "Killing pand at pid $PAND_PID"
ifconfig bnep0 down
${apath}pand -K || exit
kill $PAND_PID || exit
rm $pand_pidfile > /dev/null 2>&1 # Looks like pand may have removed it for us
sleep 1
fi

echo "Success"
;;
*)
echo "Usage: ${apath}tether.sh {start|stop}"
exit 1
;;
esac
exit 0

Attached to this post is a zip file containing two files : tether.sh and pand. Put the two files in this location on your android phone:

/data/local/

then chmod 777 the two files, these commands (as su) on the android phone will do it for you:

chmod 777 /data/local/pand

chmod 777 /data/local/tether.sh

then to test it out, start tethering on your win mobile phone, turn bluetooth on your android device, wait a little bit and then run this command as su on the android phone:

/data/local/tether.sh start

I have to do a ./tether.sh start on my phone.

You will have to edit the tether.sh file so that the mac address of your bluetooth accesspoint matches the one in the script.

Thanks!