Missing pand on OS 2008?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johan Hedberg wrote:
> On Dec 2, 2007, at 0:11, Martin Grimme wrote:
>> I have always used pand to connect to my smartphone via PAN or to  
>> build a bluetooth network between my Linux laptop and the internet  
>> tablets.
>> Now in OS 2008, I cannot find pand anymore. Is it missing, or is it  
>> hidden somewhere?
> 
> pand has been superseeded with the network service which comes  
> installed (though disabled by default) in OS2008. You can find some  
> documentation about it here:
> http://wiki.bluez.org/wiki/HOWTO/NetworkConnections
> Unfortunately one drawnback with the network service is that it  
> doesn't (yet) have a as nice command line interface as pand.
> 

Thanks fot this tip. I managed to create bnep0 interface by successively 
calling dbus-send in shell as mentioned in wiki page and parsing its 
output. There is one missing dbus-send example there - one has to call 
connection.Connect to the connection object created (called 
/org/bluez/network/connection4 in my case). One should also call 
FindConnection if one was already created, this is documented here
https://stage.maemo.org/svn/maemo/projects/connectivity/bluez-utils/tags/bluez-utils-3.22-0osso1/network/network-api.txt

I don't have full shell script for closing the connection, proper error 
recovery etc, but can confirm this really works and is possible to do 
directly from shell by calling dbus-send, see example below.

Frantisek


BTADDR=XX:XX:XX:XX:XX:XX
SERVTYPE=gn
IP=192.168.2.3
MASK=255.255.255.0

find_connection(){
#find or create connection
if res=$(dbus-send --system --type=method_call --print-reply 
--dest=org.bluez /org/bluez org.bluez.Manager.ActivateService 
string:network) ; then
     NET=$(echo $res | cut -d ' ' -f 7 | tr -d \" )
     echo destination $NET
     if res=$(dbus-send --system --type=method_call --print-reply 
--dest="${NET}" /org/bluez/network 
org.bluez.network.Manager.FindConnection string:"${BTADDR}" ) ; then
         CONN=$(echo $res | cut -d ' ' -f 7 | tr -d \" )
     else
         if res=$(dbus-send --system --type=method_call --print-reply 
--dest="${NET}" /org/bluez/network 
org.bluez.network.Manager.CreateConnection string:"${BTADDR}" 
string:"$SERVTYPE" ) ; then
         CONN=$(echo $res | cut -d ' ' -f 7 | tr -d \" )
         fi
     fi
fi
}

find_connection

if [ "$CONN" != "" ] ; then
echo connection $CONN
if res=$(dbus-send --system --type=method_call --print-reply 
--dest="${NET}" ${CONN} org.bluez.network.Connection.Connect) ; then
     BNEPDEV=$(echo $res | cut -d ' ' -f 7 | tr -d \" )
     echo connected to $BNEPDEV
fi
fi

if [ "$BNEPDEV" != "" ] ; then
ifconfig $BNEPDEV $IP netmask $MASK up
fi


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Big List of Linux Books]    

  Powered by Linux