BluetoothNetworkingAndConnectionManager

  1. Howto integrate Bluetooth IP networks into connection manager
  2. Setup a dummy access point on the Nokia
  3. Install d-bus script
  4. Automatically start the script at start-up time
  5. Call a connect and disconnect script from connection manager
  6. Connect and disconnect script

Howto integrate Bluetooth IP networks into connection manager

This allows you to connect to the Bluetooth IP network via the connection manager. Exactly the same way as you connect to a WLAN network or to a cell phone dial-up connection.

Prerequisites:

  • root access and terminal on the Nokia 770.
  • PC setup as described here
  • DHCP server running on the PC

Setup a dummy access point on the Nokia

# gconftool -s -t string /system/osso/connectivity/IAP/DEFAULT/type DUMMY

Install d-bus script

Nokia770-26:/# ls -l /usr/local/sbin/dbus-s
-rwxr-xr-x    1 root     root        15513 Sep  9 23:10 /usr/local/sbin/dbus-s

(from: http://www.arava.co.il/matan/770/dbus-s)

Automatically start the script at start-up time

Nokia770-26:/etc/init.d# cat local
#! /bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DBUSNAME=/usr/local/sbin/dbus-s
NAME=dbus-s

test -x $DBUSNAME || exit 0

case "$1" in
  start)
        echo -n "Starting dbus-s: "
        $DBUSNAME --system
        if [ $? -eq 0 ]; then
                echo "done."
        else
                echo "failed."
        fi
        ;;
  stop)
        echo -n "Stopping dbus-s..."
        kill -15 `ps uaxwww|grep $DBUSNAME|grep -v grep|cut -c 1-5`
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  force-reload)
        $0 stop
        $0 start
        ;;
  * )
        ;;
esac

exit 0
Nokia770-26:/etc/init.d#            

Nokia770-39:/etc/rc2.d# ln -s ../init.d/local S90local

Call a connect and disconnect script from connection manager

dbus-s calls this hardcoded script:

Nokia770-26:/# cat /usr/bin/dbus-script
#!/bin/sh
[ "$3" =  "com.nokia.icd" ] || exit 0
[ "$5" != "DEFAULT" -o "$7" != "CONNECTED" ] || /usr/local/bin/btconnect.script
[ "$5" != "DEFAULT" -o "$7" != "IDLE" ] || /usr/local/bin/btdisconnect.script
Nokia770-26:/# 

Connect and disconnect script

You need to replace the BT addresses with the once specific for your system. (System being the computer providing the PAN service, NOT your Nokia tablet computer.)

Nokia770-26:/# cat /usr/local/bin/btconnect.script
#!/bin/sh

insmod /mnt/initfs/lib/modules/current/bnep.ko
pand --connect 00:04:61:82:24:9F --pidfile /var/run/pand.pid
while ! pand -l|grep 00:04:61:82:24:9F ; do
  sleep 1
done
sleep 1
udhcpc -i bnep0

Nokia770-26:/# cat /usr/local/bin/btdisconnect.script
#!/bin/sh
kill -15 `ps uaxwww|grep udhcpc|grep -v grep|cut -c 1-5`
ifconfig bnep0 down
pand --kill 00:04:61:82:24:9F
#kill -15 `/var/run/pand.pid`
/sbin/rmmod bnep