| 1 | = Using Bluetooth from the command line = |
| 2 | |
| 3 | == hci, hciconfig, and hcitool == |
| 4 | |
| 5 | To Do |
| 6 | |
| 7 | {{{ |
| 8 | /etc/bluetooth/hcid.conf |
| 9 | }}} |
| 10 | |
| 11 | == rfcomm == |
| 12 | |
| 13 | The device is treated as a serial port and this utility enables to connect devices, i.e. stuff like |
| 14 | * set channel |
| 15 | * bind to a particular MAC address |
| 16 | |
| 17 | Affects file: |
| 18 | |
| 19 | {{{ |
| 20 | /etc/bluetooth/rfcomm.conf |
| 21 | }}} |
| 22 | |
| 23 | Example: |
| 24 | |
| 25 | The device on node1-2 has MAC address 00:0A:3A:53:D4:CD |
| 26 | |
| 27 | {{{ |
| 28 | node1-2:~# rfcomm -i hci0 listen 0 1 |
| 29 | Waiting for connection on channel 1 |
| 30 | Connection from 00:0A:3A:53:D4:82 to /dev/rfcomm0 |
| 31 | Press CTRL-C for hangup |
| 32 | }}} |
| 33 | |
| 34 | {{{ |
| 35 | node1-1:~# rfcomm -i hci0 connect 0 00:0A:3A:53:D4:CD 1 |
| 36 | Connected /dev/rfcomm0 to 00:0A:3A:53:D4:CD on channel 1 |
| 37 | Press CTRL-C for hangup |
| 38 | }}} |
| 39 | |
| 40 | == sdpd and sdptool == |
| 41 | |
| 42 | To Do. |
| 43 | |
| 44 | == pand == |
| 45 | |
| 46 | The daemon responsible for Personal Area Networks. Example: |
| 47 | |
| 48 | Set infrastructure mode: node1-1 as the master and node1-2 as the slave: |
| 49 | |
| 50 | {{{ |
| 51 | node1-1:~# pand --listen -role NAP --master --autozap |
| 52 | node1-1:~# ifconfig bnep0 192.168.1.1 |
| 53 | node1-1:~# ping 192.168.1.2 |
| 54 | PING 192.168.1.2 (192.168.1.2): 56 data bytes |
| 55 | 64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=53.0 ms |
| 56 | }}} |
| 57 | |
| 58 | {{{ |
| 59 | node1-2:~# pand --connect 00:0A:3A:53:D4:82 --service NAP --autozap |
| 60 | node1-2:~# ifconfig bnep0 192.168.1.2 |
| 61 | node1-2:~# ping 192.168.1.1 |
| 62 | PING 192.168.1.1 (192.168.1.1): 56 data bytes |
| 63 | 64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=74.9 ms |
| 64 | 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=39.6 ms |
| 65 | }}} |