The installed Bluez-utils package provides several useful command line tools. Each of these tools has a help feature, invoked with the -h option. Some brief examples of using these tools are given below. hcitoolUse hcitool to configure Bluetooth connections and send special commands to Bluetooth devices. For example, to discover the Bluetooth-enabled devices within range, use the scancommand: target# hcitool scan If the Bluetooth system has been configured correctly, hciconfig displays something similar to the following: target# hcitool scan Scanning… 00:16:CF:DC:B9:81 Nokia3660 00:15:4B:01:33:C5 BTGPS-321 The number "00:16:CF:DC:B9:81" is the MAC address of the associated Bluetooth device (a mobile Nokia in this instance). The software always uses the MAC address to reference a given device. l2pingWhen a device has been discovered, use l2ping to test the connection. For example, to ping the Nokia device described above, use the following command: target# l2ping 00:16:CF:DC:B9:81 If Bluetooth is configured correctly, and if the handled device is Bluetooth enabled, l2ping responds with output similar to the following: target# l2ping 00:16:CF:DC:B9:81 Ping: 00:16:CF:DC:B9:81 from 00:11:B1:07:BE:A7 (data size 44) ... 4 bytes from 00:16:CF:DC:B9:81 id 0 time 42.71ms 4 bytes from 00:16:CF:DC:B9:81 id 1 time 35.34ms ........ x sent, x received, 0% loss sdptoolAnother useful Bluetooth tool is sdptool, which provides the interface for performing SDP queries on Bluetooth devices, and administering a local sdpd daemon. sdptool provides a list of the features of the Bluetooth device to be handled. This includes ports, protocol, communication channels, and so forth. Use the browse option to get a general overview of the features of the Bluetooth device referenced by the given MAC address: target# sdptool browse 00:16:CF:DC:B9:81 If there are no errors, this command produces the following output. The exact details are determined by the configuration of the device being queried. target# sdptool browse 00:16:CF:DC:B9:81 Inquiring... Browsing 00:16:CF:DC:B9:81 Service Name:Fax Service RecHandle: 0x10000 Service Class ID List: "Fax" (0x1111) "Generic Telephony" (0x1204) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Profile Descriptor List: "Fax" (0x1111) Version: 0x0100 Service Name: Dial-up Networking Service RecHandle: 0x10001 Service Class ID List: "Dialup Networking" (0x1103) "Generic Networking" (0x1201) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 Service Name:Bluetooth Serial Port Service RecHandle: 0x10002 Service Class ID List: "Serial Port" (0x1101) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 2 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Service Name:OBEX Object Push Service RecHandle: 0x10003 Service Class ID List: "OBEX Object Push" (0x1105) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 9 "OBEX" (0x0008) Profile Descriptor List: "OBEX Object Push" (0x1105) Version: 0x0100 Service Name: OBEX File Transfer Service RecHandle: 0x10005 Service Class ID List: "OBEX File Transfer" (0x1106) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 10 "OBEX" (0x0008) Profile Descriptor List: "OBEX File Transfer" (0x1106) Version: 0x0100 ...... |
|