Linux under the use of Bluetooth __linux

Source: Internet
Author: User
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.  



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.