L2CAP (LOGICAL LINK CONTROL AND ADAPTATION PROTOCOL) LAYER

Get Complete Project Material File(s) Now! »

A brief introduction to Bluetooth

Background

Bluetooth is a wireless communication protocol which is use for short distances and in low power consumption devices. Bluetooth can be used to communicate to two are more other Bluetooth capable devices. Bluetooth is like any other communication protocol that we use every day like HTTP, FTP, SMTP, or IMAP. Bluetooth is also like these protocols in that it has client-server architecture. In Bluetooth the one who initiates the connection is the master, and the ones who receive the connection are the slaves.
It was developed by the Swedish phone maker Ericsson in 1994. Bluetooth communications operate in an unlicensed ISM band at 2.4 GHZ. Bluetooth is capable of communicating up to 30 feet at 1 Mb/s in an Omni-directional manner. It works like a radio. Bluetooth is far better to infrared because infrared requires a distance of a few feet or less and requires a line of sight for transmissions.
Bluetooth and 802.11b is created for two different goals. These both technologies operate in same frequency band: 2.4GHz. The goal of wireless LAN (802.11b) is to connect to two relatively large devices that have large of power at high speeds. Wireless LAN (802.11b) is used to connect two laptops within 300 feet at 11 Mb/s. Bluetooth is developed to connect smaller devices like PDAs and mobile phones. Bluetooth is also intended to be used as cable replacement technology. It is great to connect two PCs at moderate speed.
The Bluetooth standard was published by an industry known as the Bluetooth SIG (special interest group). SIG is responsible for expansion of Bluetooth standards .Sony Ericsson, Intel, IBM, Toshiba, Nokia, Microsoft, 3COM, and Motorola are some of the companies involved in the SIG. Microsoft supports Bluetooth in their Microsoft Windows Operating System (OS), hence, Bluetooth software is made available to the vast majority of the desktop software market. Both Nokia and Sony Ericsson consist of Bluetooth technology in their latest cell phones.
Bluetooth supports list of application like audio, graphics, and video. For example, audio devices can contain headsets, cordless and standard phones, home stereos, and digital MP3 players.

Bluetooth architecture

Bluetooth is define as a layered protocol architecture consisting of core protocols, cable replacement and telephony control protocols, and adopted protocols. Bluetooth is both a hardware-based radio system and a software stack that specifies the linkage between layers. The heart of the Bluetooth specification is the Bluetooth protocol stack.
The Bluetooth stack is made up of many layers, as shown in Fig 2.1. The HCI is typically the layer separating hardware from software and is implemented in Software and hardware/firmware. The layers below the HCI are regularly implemented in hardware and the layers above the HCI are usually implemented in software. Below u can find short description of each layer.
Baseband – Concerned with connection establishment within a pioneer, addressing, packet format, timing, and power control.
Link manager protocol (LMP) Handles communication between and the Bluetooth module

Piconet

A piconet is the usual form of a Bluetooth network and is made up of one master and One or more slaves. The device initiating a Bluetooth connection automatically becomes the master. A piconet can consist of one master and up to seven active slaves. The master device is literally the master of the piconet. Slaves may only transmit data when transmission time is granted by the master device, also slaves may not communicate directly with each other, and all communication must be directed through the master. Slaves synchronize their frequency hopping with the master using the master’s clock and Bluetooth address.
Pico nets take the form of a star network, with the master as the center node, shown in is not synchronized between piconets, hence different piconets will randomly Collide on the same frequency. When connecting two piconets the result will be a scatternet.
Fig 2.3 shows an example, with one intermediate node connecting the piconets. The intermediate node must time-share, i.e. it must follow the frequency hopping in one piconet at the time. This reduces the amount of time slots available for data transfer between the intermediate node and a master; it will at least cut the transfer rate in half. Hence communication between piconets cannot be expected to be reliable.

L2CAP (logical link Control and Adaptation Protocol) layer

L2CAP takes data from high protocol layers and send it over low layers and it passes packets either to HCI or in a host-less system, directly to LMP. L2CAP is responsible for Multiplexing between different higher layer protocols, such as RFCOMM and SDP. It allows many different applications to use a single ACL link.
It utilities ACL connections. A separate control function is required to set up and close down these connections. L2CAP transfers data, not audio. L2CAP within protocol layers are shown in Fig 2.2 Establishing a connection: To establish a link, a higher layer protocol sends a request to the L2CAP layer to connect. If there is no ACL connection, then L2CAP sends a request to the lower layer (HCL or LM) to connect. Once an ACL connection is established across the lower layers, L2CAP packets can be sent across it. Once a connection has been established and configured, it can be used to transfer data.

READ  Solidification of contaminated sediments using GGBS-based binders

RFCOMM

General Description

RFCOMM [1] protocol provides emulation of serial ports over the L2CAP. The complete communication path involves two applications running on different devices with a communication segment between them. Some capabilities and limitations of RFCOMM are as follows. It provides multiple concurrent connections by relying on L2CAP to handle multiplexing over single connections. It provides connections to multiple devices.
Many applications make use of the serial ports. The RFCOMM will make these devices more flexible by supporting easy adaptation of Bluetooth communication.
RFCOMM supports both direct communications between devices, acting as endpoints, and device modem device communication. The RFCOMM also has built in system for null modem emulation. In ordinary serial communication a baud rate is set. This will not affect the actual throughput in the RFCOMM. However, if either device is a modem type device or if data paring is done above the RFCOMM service interface, the actual throughput will reflect the baud rate setting.
The RFCOMM layer is using the L2CAP layer, which provides flow control mechanism. Therefore it is not necessary for the RFCOMM port to perform the flow Control mechanism requested by the application.

Multiple Emulated Serial Ports

The RFCOMM layer can handle up to 60 emulated ports. Two Bluetooth units using RFCOMM in their communication may open multiple emulated serial ports. These emulated serial ports are multiplexed together by the RFCOMM layer.

Limitations of using RFCOMM

• Two devices can share only one RFCOMM secession at a time.
RFCOMM protocol supports up to 60 simultaneous connections between two Bluetooth devices.
• A Single Bluetooth device can have at most 30 active RFCOMM services.
• A device can support only one client connection to any given service at a time.

Client connections using RFCOMM profile

To establish a connection using serial port profile for J2ME client is simply called as Connector. Open ().
StreamConnectionURL = (Stream Connection) Connector. Open URL);
After service discovery is completed we get Service Record object, from this we get the URL which is used to connect device. Serial port client connection URL looks like this

Device Discovery

There are various factors affecting the Bluetooth device discovery time
1) As per the Bluetooth specifications [13], the device takes at least 10.24 seconds for discovery.
2) In an error-prone environment, it is difficult to determine the maximum time required for device discovery.
3) The device discovery time exceeds even more than normal when the two devices are actively moving.
Device discovery is the first step which is used to discover nearby devices. When we have discovered nearby devices we can find out which services they offer. Discovery Agent and start inquiry method put the device into discovery mode. To use the Bluetooth related method first we need to get reference to local object by calling LocalDevice.getLocalDevice ().
Local Device object is used to obtain Discovery Agent object. Discovery Agent object is used for Device Discovery and Service Discovery. When inquiry is completed or canceled DiscoveryListener.INQUIRY_COMPLETED is invoked.

Service Discovery

Once the local device has found at least one remote device we can begin searching services on the device of interest. The following services are provided in java Bluetooth specification for service discovery. Discovery Agent, Discovery Listener, Service Record, Data Element, and UUID [3]. Discovery Agent provides methods to discover services on a Bluetooth server device, and to initiate service –discover transactions.
In order to find services on remote devices either select Service () or search Services () is used
Int transid= agent.searchServices (attributes, uuids, remoteDevice, this)
This is used to search services on a single remote Bluetooth device. RemoteDevice is the reference to the reference to the remote device that we want to search for services.
Public void device Discovered (RemoteDevice remote Device, Device Class cod)
This method is called when a remote Bluetooth device is found from an inquiry. The RemoteDevice object is a reference to the Bluetooth device found from the inquiry.
Public void services Discovered (int transID, Service Record [] service Record)
This method is called by the JVM when the services are discovered on the remote device. The Trans ID and array of service Record are provided to this method. Service Record object is used to get connectional of the remote device.

Table of contents :

1 Introduction
1.1 PURPOSE/OBJECTIVES
1.2 THESIS OUTLINE
2 A brief introduction to Bluetooth
2.1 BACKGROUND
2.2 BLUETOOTH ARCHITECTURE
2.3 PICONET
2.4 L2CAP (LOGICAL LINK CONTROL AND ADAPTATION PROTOCOL) LAYER
2.5 RFCOMM
2.5.2 MULTIPLE EMULATED SERIAL PORTS
2.5.3 LIMITATIONS OF USING RFCOMM
2.5.4 CLIENT CONNECTIONS USING RFCOMM PROFILE
2.6 DEVICE DISCOVERY
2.7 SERVICE DISCOVERY
2.8 BLUETOOTH PROFILES
3 Development tools
3.1 J2ME
3.1.1 CONFIGURATIONS AND PROFILES
3.1.2 CONNECTED LIMITED DEVICE CONFIGURATION (CLDC)
3.3 MIDLET
3.3.1 MIDLETS DEPLOYMENT
3.3.2 LOCAL DEPLOYMENT
3.3.3 REMOTE DEPLOYMENT
3.3.4 OTA OVER THE AIR
4 Implementation
4.1 SOFTWARE TOOL
4.2 DATALOGGER ARCHITECTURE
4.3 SMARTPHONES
4.4 SENDING DATA TO WEB SERVER FROM MIDLETS
5 Demonstration and some test results
5.1 DEMOSTRATION
5.2 NETWORKING DISTANCE
5.3 CO-CHANNEL INTERFERENCE
6 Conclusion and discussions
References
Appendix 1
Appendix 2

GET THE COMPLETE PROJECT

Related Posts