How to use Bluetooth tools-hciattach hciconfig hcitool sdptool RFCOMM

Source: Internet
Author: User


Create connection to BT Device




1. hci uart driver initialization,
Attach the tty device

Hciattach/dev/ttys1 any
38400
Flow


2. Open and initialize HCI Device
Hciconfig
Hci0 up


3. Get/set local name

Hciconfig
Hci0 name [name]

Hciconfig hci0 name test --- set
Name as "test"


4. Display local devices

Hcitool Dev


5. Scan for remote devices

Hcitool Scan


6. Create connection to remote
Device

Hcitool CC

 


Create
Connection to BT
SPP




1. Browse the SPP sevice

# Sdptool browse

Bdaddr

 

2. bind to a RFCOMM Device

# RFCOMM bind/dev/rfcomm0
Bdaddr

 

3. Create a connection

# Hcitool CC bdaddr


4. Open minicom
Serial device:/dev/rfcomm0
Bps/PAR/bits: 115200 8n1
Hardware Flow Control: No
Software flow control: No

# Minicom-s rfc0

 


Hcitool


Usage:
Hcitool [Options] <command> [command parameters]
Options:
-- Help display help
-I Dev HCI Device
Commands:
Dev display local devices
INQ inquire remote devices
Scan scan for remote devices
Name get name from remote device
Info get information from remote device
Spinq start periodic inquiry
Epinq exit periodic inquiry
CMD submit arbitrary HCI commands
Con display active connections
CC create connection to remote device
DC Disconnect from remote device
Sr switch Master/Slave role
CPT change connection packet type
Http: // display connection
SCSI display link quality
TPL display transmit power level
AFH display AFH Channel Map
LP set/display link policy settings
LST set/display link supervision timeout
AUTH request Authentication
ENC set Connection Encryption
Key change connection link key
Clkoff read clock offset
Clock read local or remote clock


Sdptool

Sdptool-SDP tool v4.60
Usage:
Sdptool [Options] <command> [command parameters]
Options:
-H display help
-I specify source interface
Commands:
Search search for a service
Browse browse all available services
Records request all records
Add add local service
Del Delete Local Service
Get Local Service
Setattr set/Add attribute to a SDP record
Setseq set/Add attribute sequence to a SDP record

Services:
Did SP Dun LAN fax opush FTP Print HS hsf-hf hfag sap pbap nap
GN Panu HCRP hid keyb wiimote cip ctp a2src a2snk avrdbms avrtg
Udiue udite semchla SR1 SyncML syncmlserv ActiveSync HotSync
Palmos nokid pcsuite nftp nsyncml ngage Apple isync

 

 

RFCOMM

RFCOMM Configuration Utility ver 4.60
Usage:
RFCOMM [Options] <command> <Dev>

Options:
-I [hcix | bdaddr] local HCI device or BD address
-H, -- help display help
-R, -- raw switch tty into raw Mode
-A, -- auth enable authentication
-E, -- encrypt enable Encryption
-S, -- secure connection
-M, -- master become the master of a piconet
-F, -- config specify alternate Config File
-A show all devices (default)

Commands:
Bind <Dev> <bdaddr> [Channel] bind Device
Release <Dev> release device
Show <Dev> show Device
Connect <Dev> <bdaddr> [Channel] connect Device
Listen <Dev> [Channel [cmd] Listen
Watch <Dev> [Channel [cmd] Watch

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.