|
|
2008-01-13
, 00:58
|
|
|
Posts: 40 |
Thanked: 0 times |
Joined on Jan 2008
@ France
|
#32
|
Yes, it's for Bluetooth networking. However, most of us use PAN to connect to their mobile phone. Some phones (mostly those running Windoze Mobile 5) don't support Bluetooth dialup which the Nokia tablets use for gaining internet access over the phone. Instead, the Windoze Mobile 5 phones support PAN. PAN is not directly supported by the Nokia tablets, so it's a bit difficult to set up.
And yes, you can also create private Bluetooth networks with PAN between your tablets and a computer.

|
|
2008-01-13
, 01:55
|
|
|
Posts: 79 |
Thanked: 5 times |
Joined on Jan 2008
@ England
|
#33
|
i run the script and it says
"line 107: sytax error: word unexpected (expecting "in")"
#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
exec sudo gainroot <<EOF
exec $0 $*
EOF
exit $?
fi
# real script follows
#BT MAC of PC/phone
BTADDR='00:09:DD:60:11:B6'
#bluetooth name of PC/phone, not important, just for infoprints
BTNAME="DH9JYJ2J"
#desired IP address of your tablet
IP=192.168.0.4
#default gateway - IP address of PC/phone
GW=192.168.0.3
#DNS server
NS=10.6.101.1
# remote PAN role, one of NAP, GN
PAN_ROLE=GN
infoprint(){
DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/session_bus_socket' dbus-send --session --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint "string:$*" &
}
dbus_method(){
local dest=$1
shift
DBUS_REPLY=$(dbus-send 2>&1 --system --type=method_call --print-reply --dest="$dest" $* )
}
dbus_result(){
echo $DBUS_REPLY | cut -d ' ' -f 7 | tr -d \"
}
find_connection(){
#find or create connection
if dbus_method org.bluez /org/bluez org.bluez.Manager.ActivateService string:network ; then
NET_BUS=$(dbus_result)
# echo destination $NET_BUS
if dbus_method "${NET_BUS}" /org/bluez/network org.bluez.network.Manager.FindConnection string:"${BTADDR}" ; then
CONN=$(dbus_result)
else
if dbus_method "${NET_BUS}" /org/bluez/network org.bluez.network.Manager.CreateConnection string:"${BTADDR}" string:"$PAN_ROLE" ; then
CONN=$(dbus_result)
fi
fi
fi
}
bnep_start(){
#find_connection
if [ "$CONN" != "" ] ; then
echo connection $CONN
if dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.Connect ; then
BNEPDEV=$(dbus_result)
echo connected to $BNEPDEV
ifconfig $BNEPDEV $IP up
if route -n | grep -q '^0.0.0.0' ; then
echo "default gateway already set, skipping GW and DNS setting"
else
route add default gw $GW
echo "nameserver $NS" >/tmp/resolv.conf.lo
fi
[ -t 1 ] || infoprint "Connected to $BTNAME"
fi
fi
}
bnep_stop(){
#find_connection
if [ "$CONN" != "" ] ; then
echo connection $CONN
if dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.Disconnect ; then
echo "OK, bringing down"
echo -n '' >/tmp/resolv.conf.lo
[ -t 1 ] || infoprint "$BTNAME disconnected"
fi
fi
}
echo "Searching for $BTADDR ..."
[ -t 1 ] || infoprint "Searching for $BTADDR"
find_connection
if [ "$CONN" = "" ] ; then
echo $DBUS_REPLY
echo "Setting up connection to $BTADDR failed"
[ -t 1 ] || infoprint "Connection to $BTADDR failed"
exit
fi
COMMAND=$1
if [ "$COMMAND" = "" ] ; then
dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.IsConnected
if [ "$(dbus_result)" = "true" ] ; then
COMMAND=stop
else
COMMAND=start
fi
fi
case $COMMAND in
start) bnep_start ;;
stop) bnep_stop ;;
esac
|
|
2008-01-22
, 20:51
|
|
Posts: 49 |
Thanked: 7 times |
Joined on Apr 2007
|
#34
|
|
|
2008-01-22
, 21:18
|
|
Posts: 1 |
Thanked: 0 times |
Joined on Jan 2008
|
#35
|
|
|
2008-01-24
, 17:11
|
|
Posts: 26 |
Thanked: 1 time |
Joined on Jan 2008
|
#36
|
|
|
2008-01-25
, 20:31
|
|
Posts: 60 |
Thanked: 7 times |
Joined on Jan 2008
|
#37
|
~ $ chmod +x pan
~ $ ./pan
|
|
2008-01-31
, 11:15
|
|
Posts: 5 |
Thanked: 1 time |
Joined on Jan 2008
|
#38
|
|
|
2008-01-31
, 11:48
|
|
Posts: 2,152 |
Thanked: 1,490 times |
Joined on Jan 2006
@ Czech Republic
|
#39
|
| The Following User Says Thank You to fanoush For This Useful Post: | ||
|
|
2008-01-31
, 23:22
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Jan 2008
|
#40
|
i run the script and it says
"line 107: sytax error: word unexpected (expecting "in")"
"line 107: sytax error: word unexpected (expecting "in")"