1. Activating the device
The first thing to have is a Bluetooth adapter, which, needless to say, is typically a USB interface type.
Lsusb View the Bluetooth devices connected in the system
hciconfig View the details of the device
Hciconfig hci0 up to activate the device
2. Configure BlueZ
Configuration file is located in directory/etc/bluetooth 3. Bluetooth Services
/etc/rc.d/init.d/bluetooth Stop
/etc/rc.d/init.d/bluetooth start
4. Scanning Equipment
Hcitool Scan
Use the above command to find the surrounding Bluetooth devices
5. Binding Devices
There are two ways to bind the destination Bluetooth device
@1 Modify/etc/bluetooth/rfcomm.conf
@2 Rfcomm bind/dev/rfcomm0 XX:XX:XX:XX:XX:XX
The Unbind method is
# Rfcomm UNBIND/DEV/RFCOMM0 bd_addr Channel
Tip: If you do not have a virtual serial device (RFCOMM0), you need to create it manually (Rfcomm_create_dev?)
# MKNOD/DEV/RFCOMM0 C 216 1
# chmod 666/DEV/RFCOMM0
6. Add Channel
Sdptool add--channel=1 DID SP DUN LAN FAX opush FTP HS HF SAP NAP GN panu HID CIP CTP a2src a2snk SYNCML nokid pcsuite SR 1
The following parameters represent all the services supported by the system
7. Connecting Equipment
Hcitool cc XX:XX:XX:XX:XX:XX
8. Send the file
Obex-send *.*
9. BlueZ Tools
bccmd:used to issue BlueCore commands to Cambridge Silicon.
Bluetoothd:the Bluetooth Daemon. Ciptool:used to set up, maintain, and inspect the CIP configuration of the "Bluetooth subsystem in" Linux Kern
El. hciattach:used to attach a serial UART to the Bluetooth stack as HCI transport interface.
hciconfig:used to configure Bluetooth devices.
hcitool:used to configure Bluetooth connections and send some special command to Bluetooth devices.
hid2hci:used to set up switch supported Bluetooth devices into the HCI mode and back.
l2ping:used to send a l2cap echo request to the Bluetooth MAC address given in dotted hex notation.
rctest:used to test RFCOMM communications on the Bluetooth stack. Rfcomm:used to set up, maintain, and inspect the Rfcomm configuration of the Bluetooth subsystem in the Linux K
Ernel.
sdptool:used to perform SDP queries on Bluetooth devices. LibbLuetooth.so:contains the BlueZ 4 API functions.