Synapse ↵

logically incoherent… not!

Bluetooth in Linux

bluetooth_logo

This is a tutorial to enlighten you about how to use Bluetooth in Linux. Bluetooth is a short distance communication standard. The most common bluetooth stack used in Linux is BlueZ. BlueZ was originally developed by Qualcom and later made OpenSource. Since version 2.4.6 it is included in the Linux kernel distribution. So the first thing you have to do is install BlueZ on your Linux box. Just do a google search for bluez and install it on your system. You can get BlueZ from http://bluez.sourceforge.net

Once you are done with this, the next step is to start the bluetooth service. This can be done manually by the following command -

sh /etc/init.d/bluetooth start

The next step is to see if your bluetooth adapter is working properly by scanning for nearby bluetooth devices. This is where we use a tool called hcitool. Enable the bluetooth on your device (mobile) and run the following command -

hcitool scan

The above command will give you output as below -

Scanning …

00:0E:6D:9A:34:21 synapse

The address of your device as well it’s name gets detected in the scan. The next obvious thing to do with our bluetooth enabled linux box is to learn how to transfer and receive files. Files are transferred using a high level protocol called OBEX (Object Exchange). Run the following command and replace my bluetooth address with yours -

sdptool browse 00:0E:6D:9A:34:21

A portion of the output I got is shown below -

Service Name: OBEX Object Push
Service RecHandle: 0×10003
Service Class ID List:
“OBEX Object Push” (0×1105)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 9
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0×656e
encoding: 0×6a
base_offset: 0×100
Profile Descriptor List:
“OBEX Object Push” (0×1105)
Version: 0×0100

The ‘Object Push’ service uses RFCOMM channel 9. To upload a file run the following command in the terminal -

obex_push 00:0E:6D:9A:34:21 a.txt

This will transfer the file ‘a.txt’ to the device with the above mentioned address. The same command (obex_push) invoked without any commands can be used to recieve files. For more information type ‘man obex_push’ in the terminal.

This is the end of the basic tutorial on how to use bluetooth in Linux to transfer and receive files. I will be adding more tutorials to perform other functions.

November 30, 2005 - Posted by synapse | Linux | | 6 Comments

6 Comments »

  1. big tit tgp

    gimmemoney 209114 Information source about big tit tgp.

    Trackback by big tit tgp | January 15, 2007 | Reply

  2. dragon tale picture

    SomegifttoME 209114 Search results for ‘dragon tale picture’.

    Trackback by dragon tale picture | February 5, 2007 | Reply

  3. tele cinco

    Intresting information about tele cinco.

    Trackback by tele cinco | February 17, 2007 | Reply

  4. grattis hasardspel spel…

    cardboard Zimmerman banishes:railroaders …

    Trackback by grattis hasardspel spel | July 20, 2008 | Reply

  5. texas holdem pokar playing tips…

    subtracts!constitutional peppy?subscripted sandpaper wooden …

    Trackback by texas holdem pokar playing tips | September 4, 2008 | Reply

  6. wu casino on the web…

    grandmother ripe!spying fog …

    Trackback by wu casino on the web | January 23, 2009 | Reply


Leave a comment