PLEASE NOTE: This article is obsolete or related to a discontinued product.

How to use an USB Bluetooth adapter

Bluetooth is a radio-frequency communication protocol. This article explains how to use an USB Bluetooth adapter on the FOX Board

"Bluetooth is an industrial specification for wireless personal area networks (PANs). Bluetooth provides a way to connect and exchange information between devices such as mobile phones, laptops, PCs, printers, digital cameras and video game consoles via a secure, globally unlicensed short-range radio frequency" from (Wikipedia Bluetooth definition).

This article explains how to use an USB Bluetooth adapter on the FOX Board and how to implements some services on it like device scanning and object pushing.

Quick start guide

To quickly try bluetooth on your FOX Board you need:

  • An USB Bluetooth adapter (we have used the model available in the eShop section of this article but any USB dongle should be usable)
  • A bluetooth enabled mobile phone, PDA, etc.

Download a ready to use flash image for your FOX Board model:

and flash it on your FOX Board (see How to reflash a FOX Board).

Login your FOX Board and type:

# cdBluez-start
Using /lib/modules/2.6.15/kernel/net/bluetooth/bluetooth.ko
Using /lib/modules/2.6.15/kernel/net/bluetooth/l2cap.ko
Using /lib/modules/2.6.15/kernel/net/bluetooth/rfcomm/rfcomm.ko
Using /lib/modules/2.6.15/kernel/drivers/bluetooth/hci_usb.ko

with this command you start the Bluetooth stack. Now turn on a Bluetooth device and scan the active devices typing:

# hcitool scan

If everything is OK you should obtain the Bluetooth devices address list.

Scanning ...
        00:16:20:8F:BA:60       Z520i
        00:12:56:C2:88:17       Sergio
        08:00:46:EA:CA:12       NOME-YOMKTFIKO9

To found the devices who gets available OPUSH services type:

# sdptool search OPUSH
Inquiring ...
Searching for OPUSH on 00:16:20:8F:BA:60 ...
Service Name: OBEX Object Push
Service RecHandle: 0x10005
Service Class ID List:
  "OBEX Object Push" (0x1105)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 5
  "OBEX" (0x0008)
Profile Descriptor List:
  "OBEX Object Push" (0x1105)
    Version: 0x0100

Now you can try to send and image to your mobile. For example let we send this TUX Case image:

If you have your FOX Board connected to internet you can get this image directly from the Acme site typing:

# cd /mnt/flash
# wget http://80.241.169.67/articles/00112/tuxcase.jpg
Connecting to 80.241.169.67[80.241.169.67]:80
tuxcase.jpg          100% |*****************************|  4710       00:00 ETA

Then to send it to your mobile type:

# ussp-push 00:16:20:8F:BA:60@5 tuxcase.jpg tuxcase.jpg
name=tuxcase.jpg, size=4710
Local device 00:02:72:81:4A:EC
Remote device 00:16:20:8F:BA:60 (5)
Connection established
If everything goes ok you will have the TUX Case on your mobile phone:

The format of ussp-push command is:

# ussp-push addressdevice@channel localfile remotefile

BlueZ libraries

The Bluetooth stack is implemented by different layers:
  1. Radio communication layer. In the lower hardware level layer.
  2. Link manager layer, used to connect physically the devices
  3. HCI layer (Host Controller Interface) This layer is used to link phisically the devices with the operative system.
  4. L2Cap layer. The Logical Link Control & Adaptation Protocol, to link logically the devices.
  5. Application layer. This layer is used to communicate with applications using different profiles.

Some implementations on the fifth layer are:

  • RFComm: Emulate a Serial Communications
  • OBEX: File Transfer and Management
  • SDP: to inquiry devices and get infos about it
  • BNEP (Bluetooth Network Encapsulation Protocol): to encapsulate TCP/IP over Bluetooth

BlueZ is the official Bluetooth protocol stack for Linux (www.bluez.org).
It provides the libraries to interface the applications with the Bluetooth utilities and services.

OpenOBEX

"OpenOBEX is an open source implementation of the Object Exchange (OBEX) protocol. OBEX is a session protocol and can best be described as a binary HTTP protocol. OBEX is optimised for ad-hoc wireless links and can be used to exchange all kind of objects like files, pictures, calendar entries (vCal) and business cards (vCard)" (definition from http://openobex.triq.net)

ussp-push

Ussp-push is a OBEX object pusher for Linux, using the BlueZ Bluetooth stack. With this utility it is possible to send a file to a remote Bluetooth device.

How to enable the Bluetooth support inside the FOX Board SDK

Inside the SDK root directory tyoe:
# make menuconfig
Then enable the Bluetooth support from this voices:
Driver settings
  Bluetooth BlueZ libraries and tools
		[*] OpenObex
		[*] ussp-push
Then save, exit and type:
# ./configure
...
# make
Now reflash your board with the new fimage.

Related links

Credits

Thanks to Gabriele Giottoli co-founder of:


http://www.confinidigitali.it

a company involved in creating technological products with a high degree of innovation. Confinidigitali offers its experience in the hardware and software design based on the Acme Systems FOX Board following the customer in all the stages of product development.