Affix - End User Manual: Affix (v. 3.0.0) - Open Source Bluetooth Protocol Stack for Linux | ||
---|---|---|
Prev | Chapter 4. Persona Area Network | Next |
From the client's point of view there is no difference whether your server has router or bridge configuration. The following steps are needed to establish a connection to a NAP.
When you are connecting the first time edit /etc/affix/affix.conf file. Check that value "pan_role="panu" is enabled and role "nap" is disabled. After editing configuration file restart PAN giving the following commands.
btpan stop
btpan init [panu]
Connect to NAP you habe set up. Give command:
btpan -s connect <address>
Parameter -s prevents SDP query as you probably do not have SDP daemon running on the NAP server. If you leave the parameter out remember to start SDP daemon on server (run btsrv).
To check your connection type cat /proc/net/affix/pan. It lists all your active PAN connection. The example below states that your host is PAN user and it has connection to NAP which Bluetooth device address is 00:0c:76:b1:08:76.
The previous phase was analogous to connecting network cable to a traditional network interface card. The physical connection now exists. To transfer data over the line you still need to set the IP address for the network interface (pan0). You can try to run DHCP client manually or just set the address using ifconfig. Do one of the following.
If you had DHCP server running on the NAP or it was configured as a bridge and your LAN has DHCP server you use DHCP to obtain the IP address.
Add setting for pan0 interface to /etc/network/interfaces file to use ifup and ifdown scripts to bring network connection up and down. Add the line below into the file. It is also recommended to install ifplugd (in Debian) utility. It will automatically bring pan0 interface up when you plug your Bluetooth device in your computer. The ifplugd configuration is as for router. See the previous section for instructions.
Example 4-5. PANU pan0 interface up configuration
iface pan0 inet dhcp //if you do not use dhcp replace 'dhcp' with 'manual'
If you did not install ifplugd you can bring the network connection up easily giving ifup pan0 as a root and respectively bring it down using command ifdown pan0.
To start DHCP manually give command dhclient pan0
In case you do not have DHCP set the IP address manually. Give command ifconfig pan0 <address> up.
Now you have a network connection established. You can add more PANUs (up to 7) repeating these steps in each client computer.
Note! If you have problems accessing network check that the routing information is correct. It should use pan0 interface as a default gateway. If you give route command the routing information might look like the following.