Useful bluetooth commands

From wiki.network-crawler.de
Jump to: navigation, search

For my Gentoo I need:

emerge bluez-utils
emerge openobex
modprobe bluetooth

And u should of course build u re Kernel with Bluetooth stuff as Module.

Configure Devices

# hciconfig 
hci0:   Type: USB
        BD Address: 00:xx:xx:xx:xx:xx ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING 
        RX bytes:87 acl:0 sco:0 events:10 errors:0
        TX bytes:41 acl:0 sco:0 commands:9 errors:0

Local Devices

# hcitool dev
Devices:
        hci0    00:xx:xx:xx:xx:xx

Request Devices

# hcitool inq
Inquiring ...
        00:DE:AD:BE:EF:00       clock offset: 0x556e    class: 0x520204

Scan for Devices

# hcitool scan
Scanning ...
        00:DE:AD:BE:EF:00       <Devicename>

Config files:
/etc/bluetooth/hcid.conf # 4 example the Name of the local Device

/etc/bluetooth/pin # The Pin

Nice 2 have (I use it with my T610):

emerge app-mobilephone/obexftp

Directory list:

obexftp -b 00:DE:AD:BE:EF:00 -l
Browsing 00:DE:AD:BE:EF:00 ...
Channel: 7
No custom transport
Connecting...bt: 1
done
Receiving (null)... <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
<!--
Generated by XML Coder.
xml_coder.c (Dec  3 2003 20:37:29)
(C) 2001 Sony Ericsson Mobile Communications AB, Lund, Sweden
-->
<folder-listing version="1.0"><folder name="Bilder"/>
<folder name="Töne"/>
<folder name="Displayprofile"/>
</folder-listing>
done
Disconnecting...done

List Directory "Bilder"

 obexftp -b 00:DE:AD:BE:EF:00 -l Bilder

Get Addressbook:

obexftp -b  00:DE:AD:BE:EF:00 -B 10 -g telecom/pb.vcf

Possible Commands:

telecom/devinfo.txt     Information hardware	GET
telecom/rtc.txt 	The Real Time Clock	GET/PUT
telecom/pb.vcf  	Level 2 access (Access	GET/PUT
telecom/pb/luid/.vcf	Add new entry   	PUT
telecom/pb/0.vcf	Own business card	GET/PUT
telecom/pb/###.vcf	Level 3 static index access	GET/P UT
telecom/pb/luid/*.vcf	Level 4 unique index access	GE T/PUT
telecom/pb/info.log	Supported properties and memory info	GET
telecom/pb/luid/###.log	Change log	GET
telecom/pb/luid/cc.log  Change counter	GET
telecom/cal.vcs	Calendar  Level 2 access	GET/PUT
telecom/cal/luid/.vcs	Add new entry	PUT
telecom/cal/###.vcs	Level 3 static index access	GET/ PUT
Telecom/cal/luid/*.vcs	Level 4 unique index access	G ET/PUT
Telecom/cal/info.log	Supported properties and memory info 	GET
Telecom/cal/luid/###.log	Change log	GET
Telecom/cal/luid/cc.log	Change counter	GET 

References:

http://ale.shouldshave.org/t630_linux.html http://www.betaversion.net/btdsd/ http://www.gentoo.org/doc/en/bluetooth-guide.xml