Connection to a PC via PAN

Motivation

Since RFCOMM/PPP Connection Setup is very annoying when developing on a long-term base, it makes more sense to use the PAN profile.
The PAN profile uses the same system as a RFCOMM/PPP connection internally but hides this fact under virtual ethernet interfaces on both sides.

Setup Linux PC

On the Linux PC, it is useful to create a script that runs as a daemon at boot time so the service is also available after a reboot.

/etc/init.d/pand

# Start the PAND
PAND=/usr/bin/pand
PAND_OPTIONS="--listen --master --role NAP"
case "$1" in
  start)
        echo "Starting PAND now..."
        start-stop-daemon --start --quiet --exec $PAND --  $PAND_OPTIONS || true
        echo "."
        ;;
  stop)
        echo "Closing Connections and stop PAND..."
        $PAND -K
        start-stop-daemon --stop --quiet --exec $PAND || true
        echo "."
 ;;

  *)
 echo "Usage: /etc/init.d/pand {start|stop}"
 exit 1
esac

exit 0

 

Setup PDA

On the PDA we also create a small script. However, it is linked to a "Desktop" symbol and can be started on demand.

/opt/QtPalmtop/MySkripts/pan

#!/bin/sh
pand -c 00:A0:96:1F:21:81
sleep 5
ifconfig bnep0 192.168.200.2
route add default gw 192.168.200.1


/opt/QtPalmtop/apps/Applikations/pan-connection.desktop

[Desktop Entry]
Comment=pan Verbindung
Exec=/opt/QtPalmtop/MySkripts/pan
Icon=pan-connection
Type=Application
Name=pan-connection