Bluetooth

Bluetooth is a wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks (PANs). It was originally conceived as a wireless alternative to RS232 data cables. It can connect several devices, overcoming problems of synchronization.

His name is directly inspired by the Danish King Harald I Harald Blatand nickname ( "the man in blue tooth"), known for his success in unifying the states of Denmark, Norway and Sweden. The Bluetooth logo design merges the Germanic runes analogous to the modern Latin letters H and B:  (for Harald Bluetooth) (Hagall) and (Berkanan) merged together, forming a bind rune.


The protocol stack

To ensure compatibility between all Bluetooth devices, most of the protocol stack is defined in the specification.

Layers Bluetooth

The link controller (LC)

This layer manages the configuration and control of the physical link between two devices.


The link manager (LM)

This layer manages the relationship between master and slave devices and the types of links (synchronous or asynchronous).

It is the connections manager that implements the security mechanisms such as:

  • authentication
  • the pairing
  • creating and editing keys,
  • and encryption.


The Host  control interface (HCI)

This layer provides a uniform method to access the material layers. Its role separation allows independent development of hardware and software.
The transport protocols are supported:

  • Universal Serial Bus (USB);
  • PC-Card;
  • RS-232;
  • UART.

Means L2CAP Logical Link Control and Adaptation Protocol. HCI allows data transfer at maximum speed, or 720 kbit / s for the standard 1.2, and a rate three times higher for the standard 2.0 + EDR.


Multiplexing

This layer allows you to simultaneously use different protocols at higher levels.
A mechanism to identify the protocol of each packet sent to enable the remote machine to move the package to the proper protocol, once it recovered.


Segmentation and reassembly

The L2CAP layer is also the segmentation (and re) packaging protocols at higher levels in packets of 64 KB link.


Services

RFCOMM: (Cable replacement protocol) Radio frequency communications (RFCOMM) is the cable replacement protocol used to create a virtual serial data stream. RFCOMM provides for binary data transport and emulates EIA-232 (formerly RS-232) control signals over the Bluetooth baseband layer.

RFCOMM provides a simple reliable data stream to the user, similar to TCP. It is used directly by many telephony related profiles as a carrier for AT commands, as well as being a transport layer for OBEX over Bluetooth.

Many Bluetooth applications use RFCOMM because of its widespread support and publicly available API on most operating systems. Additionally, applications that used a serial port to communicate can be quickly ported to use RFCOMM.

SDP: (Service Discovery Protocol): Used to allow devices to discover what services each other support, and what parameters to use to connect to them.

For example, when connecting a mobile phone to a Bluetooth headset, SDP will be used to determine which Bluetooth profiles are supported by the headset (Headset Profile, Hands Free Profile, Advanced Audio Distribution Profile etc) and the protocol multiplexer settings needed to connect to each of them. Each service is identified by a Universally Unique Identifier (UUID), with official services (Bluetooth profiles) assigned a short form UUID (16 bits rather than the full 128)

BNEP: (Bluetooth Network Encapsulation Protocol) BNEP is used to transfer another protocol stack's data via an L2CAP channel. Its main purpose is the transmission of IP packets in the Personal Area Networking Profile. BNEP performs a similar function to SNAP in WirelessLAN.

AVCTP: (Audio/Visual Control Transport Protocol) Used by the remote control profile to transfer AV/C commands over an L2CAP channel. The music control buttons on a stereo headset use this protocol to control the music player.

AVDTP: (Audio/Visual Data Transport Protocol) Used by the advanced audio distribution profile to stream music to stereo headsets over an L2CAP channel. Intended to be used by video distribution profile.

Telephone control protocol: Telephony control protocol-binary (TCS BIN) is the bit-oriented protocol that defines the call control signaling for the establishment of voice and data calls between Bluetooth devices. Additionally, “TCS BIN defines mobility management procedures for handling groups of Bluetooth TCS devices”


Bluetooth Standards

The Bluetooth standard relies on different standards:

  • IEEE 802.15.1 standard defines the Bluetooth 1.x to obtain a flow rate of 1 Mbit / s;
  • IEEE 802.15.2 proposes recommendations for the use of the frequency band 2.4 GHz (frequency also used by Wi fi). This standard is not yet validated;
  • IEEE 802.15.3 is a standard being developed to offer high-speed (20 Mbit / s) with Bluetooth technology;
  • IEEE 802.15.4 is a standard being developed for Bluetooth applications at low flow rates.

 

The basic elements of a Bluetooth product are defined in the first two layers of protocol, the radio layer and the base band layer. These layers are responsible for the physical tasks such as control of frequency hopping and synchronization of clocks.


Layer radio (RF)

The radio layer (the lowest layer) is managed in hardware.
She handles the issuance and receipt of radio waves.
It defines characteristics such as frequency band and channel arrangement, the characteristics of the transmitter, modulation, receiver, etc..
The Bluetooth system operates in the frequency bands * ISM (Industrial, Scientific and Medical) 2.4 GHz, whose operation requires no license. This band is between 2 400 and 2 483.5 MHz.
The 79 RF channels are numbered from 0 to 78 and separated by 1 MHz, starting with 2 402 MHz.
The information coding is done by frequency hopping. The period is 625
μs, allowing 1 600 jumps per second.
There are three classes of Bluetooth radio modules on the market with different powers and thus different ranges:

 

Class Power
Range
1 100mW (20dBm)  100 meters 
2 2,5mW (4dBm) 10 meters
3 1mw (0dBm) 1 meter

In most cases the effective range of class 2 devices is extended if they connect to a class 1 transceiver, compared to a pure class 2 network. This is accomplished by the higher sensitivity and transmission power of Class 1 devices.

Version Data Rate 
Version 1.2 1 Mbits/s
Version 2.0 + EDR 3 Mbits/s
WiMedia alliance (Proposed) 53 - 480 Mbits/s 


The Baseband

The baseband is also managed at the hardware level.
It is at the base band that defined the hardware address of devices (equivalent to the MAC address of a network card). This address is called BD_ADDR (Bluetooth Device Address) and is coded on 48 bits. These addresses are managed by the IEEE Registration Authority.
It is also the base band that manages different types of communication between the devices. Connections established between two Bluetooth devices can be synchronous or asynchronous.

List of applications

More prevalent applications of Bluetooth include:

  • Wireless control of and communication between a mobile phone and a hands-free headset. This was one of the earliest applications to become popular.
  • Wireless networking between PCs in a confined space and where little bandwidth is required.
  • Wireless communication with PC input and output devices, the most common being the mouse, keyboard and printer.
  • Transfer of files, contact details, calendar appointments, and reminders between devices with OBEX.
  • Replacement of traditional wired serial communications in test equipment, GPS receivers, medical equipment, bar code scanners, and traffic control devices.
  • For controls where infrared was traditionally used.
  • Sending small advertisements from Bluetooth-enabled advertising hoardings to other, discoverable, Bluetooth devices.
  • Two seventh-generation game consoles, Nintendo's Wii and Sony's PlayStation 3, use Bluetooth for their respective wireless controllers.
  • Dial-up internet access on personal computers or PDAs using a data-capable mobile phone as a modem.


Implementation

To exchange data, the devices must be paired. The pairing is done by starting from the discovery of a device and exchanging a code. in some cases, the code is free, and it is sufficient for both devices to enter the same code. In other cases, the code is set by one of two devices (device without keyboard, for example), and one must know to get connected. Thereafter, the codes are stored, and just a device to ask for the connection and the other accepts that the data can be exchanged. To limit the risk of intrusion, devices that use a pre-code (usually 0000) must be activated manually, and pairing can only be done during a short period.


Material used f2m03gla module

For our applications, we will use the bluetooth module F2M03GLA type of firm Free2move, this module has the following characteristics:

  • Bluetooth V2.0 + EDR
  • Low consumption
  • Antenna
  • Configurable Class 1/2/3
  • Transmission distance up to 350m (open)
This module contains several interfaces that can be used according to the needs of applications, these interfaces are:
  • Interface UART (serial)
  • USB Interface
  • SPI Interface
  • I2C Interface
  • PCM
  • PIOs
you can find the datasheet of the module here.

In our applications, a card of adjustment is used to insert the module more easily on different prototypes. You can get this card for adaptation to society Lextronic France (www.lextronic.fr).

You can see the result of a card of this adaptation.

Bluetooth adapter

Further information on the module F2M03GLA can be found on the website of the company: www.free2move.net