SlideShare a Scribd company logo
1 of 36
TABLE OF CONTENTS
Hardware Used ..........................................................................................................................3
Softwares Used..........................................................................................................................3
Control Flow ..............................................................................................................................4
Bluetooth Module..................................................................................................................4
LPC Xplorer Board .................................................................................................................4
Android Application...............................................................................................................5
UART Interfacing ...................................................................................................................6
Hardware Details.......................................................................................................................8
Roving Network Bluetooth Module (rn41-ek).......................................................................8
Pin-out ................................................................................................................................9
Command Mode v/s Data Mode........................................................................................9
LPC1830 Xplorer Board........................................................................................................ 11
Introduction...................................................................................................................... 11
Board Features ................................................................................................................. 11
Block Diagram..................................................................................................................12
Setup for NXP LPCLink and LPC1830 Xplorer Board ......................................................12
Steps to setup the LPC-Link and LPC1830 Xplorer Board .............................................. 13
Software Details......................................................................................................................14
LPCXpresso ..........................................................................................................................14
Features............................................................................................................................14
Development Boards .......................................................................................................15
LPC-Link and LPC-Link2 ..................................................................................................16
Android Developer Tools (ADT).......................................................................................... 17
Integrated Android project creation, building, packaging, installation, and debugging17
SDK Tools integration...................................................................................................... 17
Java programming language and XML editors................................................................18
SDK Tools Integration......................................................................................................19
Bluetooth Technology.............................................................................................................20
Bluetooth Core Specification ..............................................................................................20
TableOf Contents 2
Spectrum..........................................................................................................................21
Interference ......................................................................................................................21
Range................................................................................................................................21
Power................................................................................................................................22
Piconet..............................................................................................................................22
Scatternet.........................................................................................................................23
GATT Based......................................................................................................................24
BR/EDR Profiles................................................................................................................25
BR/EDR Protocols.............................................................................................................27
Bluetooth Layers..................................................................................................................28
Bluetooth Profile – SPP (Service Port Profile).................................................................28
SDP (Service Discovery Protocol)....................................................................................29
RFCOMM ..........................................................................................................................29
L2CAP (Logical Link Control and Adaptation Protocol) .................................................30
HCI (Host Controller Interface) ........................................................................................32
Link Manager.................................................................................................................... 33
Baseband Layer................................................................................................................ 33
Future Scope............................................................................................................................35
References ...............................................................................................................................36
Hardware Used 3
HARDWARE USED
1. Bluetooth Module:Roving Networks rn 41-ek
2. Base Board:LPC1830 Xplorer Board
3. Program flash/Debugger: LPC Link 2
4. Cables for connection:
 Single pin female headers for connection between Bluetooth module and
base board.
 One USB to mini B for serial datatransfer to LPC link 2.
 One mini USB for powering up of base board
SOFTWARES USED
1. LPC Xpresso
2. Android Development Tool(ADT)
Control Flow 4
CONTROL FLOW
BLUETOOTH MODULE
1. Configured in Slave Mode whereby other Bluetooth devices can discover and
connect to the module.
2. The serial port settings are set to:
a. Baudrate 115,200
b. 8 bits
c. No Parity
d. 1 stop bit
e. Hardware flow control enabled
3. Acts as a gatewaypassing datato/from theUART
LPC XPLORER BOARD
1. Configures theBluetooth module
2. Sends and receives datafrom UART
3. Decodescommands received to controltheLEDS
Control Flow 5
ANDROID APPLICATION
The androidapplicationhasthefollowing features:-
1. Menu Items
a. Turn Bluetooth On
b. Turn Off Bluetooth
c. Connect to Remote Device
 Shows list ofPaired Devices to select from
 Also Scans for New Devices
d. Disconnect theConnection
2. Connection Status
a. Gives the status of whetherconnection was established successfully or not.
3. Switches
a. To controltheturning on and off of different LEDS
Program code for the Android Application is provided separately in CD.
Control Flow 6
UART INTERFACING
A universal asynchronous receiver/transmitter, abbreviated UART, is a piece of computer
hardware that translates data between parallel and serial forms. UARTs are commonly used
in conjunction with communication standards such as EIA, RS-232, RS-422 or RS-485.
The universal designation indicates that the data format and transmission speeds are
configurable. The electric signaling levels and methods (such as differential signaling etc.)
are handled by a driver circuit external to theUART.
A UART usually contains the following components:
 a clockgenerator, usually a multipleofthebit rateto allowsampling in themiddleof a
bit period.
 input and output shift registers
 transmit/receive control
 read/write control logic
 transmit/receive buffers (optional)
 paralleldatabus buffer (optional)
 First-in, first-out (FIFO) buffer memory (optional)
LPC1830 includes four 550 UARTs with DMA support: one UART with full modem interface;
one
UART with IrDA interface; threeUSARTs support synchronous mode and a smart
card interface conforming to ISO7816 specification.
Descriptionof 550 UARTs:
This UART has 16-byte FIFO buffers. Its receive interrupt trigger levels can be set to 1, 4, 8,
or 14 characters. Its maximum standard serial port speed if the operating system has a 1
millisecond interrupt latency is 115.2 Kbit/s. Operating systems with lower interrupt
latencies could handle higher baud rates like 230.4 Kbit/s or 460.8 Kbit/s. This chip can
provide signals to facilitate a third party DMA controller perform DMA transfers to and
from the UART. This was known as DMA mode because it was meant to be coupled with a
DMA controller in this mode to perform the transfers on behalf of the CPU. It was
introduced by National Semiconductor, which has been sold to Texas Instruments. National
Semiconductorclaimed that thisUART could physicallyrun at up to 1.5 Mbit/s.
Control Flow 7
UART coding
In the project UART of the base board is configured for receive mode. It works in a
continuous polling mode. Configurationof UART is:
 Dataflow rate= 9600bps
 Datalength=8 databit
 Parity= None
 Stop bit=1
 No flow control
 Receive enable
Program code for the UART transmission is provided separately in CD.
Descriptionabout coding:
 Firstly theUART is configured to function according to user need. As theboard has to
receive dataonlytherefore onlyreceive modeis enabled.
UART_Init ((LPC_USARTn_Type*) DEBUG_UART_PORT, &UARTConfigStruct);
 As LPC1830 pins are multifunctional,therefore, thepins that provideUART
functionalityare configures as Rx and Tx pins.
scu_pinmux (0x6, 5, MD_PDN|MD_EZI, FUNC2);
 UART Rx FIFO buffer is initialized to receive datasent by Bluetooth module.
UART_FIFOConfigStructInit (&UARTFIFOConfigStruct);
 After that thecode runs in a whileloop where it waits for thecharacter received and
after receiving a character it is compared with thepredefined character which on
success turns on/off theLEDs of thebase board.
 The receive methodson successfully receiving thecharacter returns thenumber of
bytessent which is used as a counter for inner loop.
len = UART_Receive ((LPC_USARTn_Type*) DEBUG_UART_PORT, buffer, sizeof(buffer),
NONE_BLOCKING);
 After the end of main method thereis checkfail methodwhich is used for debugging.
Inside this methoduser can addhis own implementationto report the filename and line
number.
Ex: printf ("Wrongparameters value: file %s on line %drn", file, line)
Hardware Details 8
HARDWARE DETAILS
ROVING NETWORK BLUETOOTH MODULE (RN41-EK)
The RN-41-EK evaluationboard is field-ready,Bluetooth SIGqualified prototyping
platforms for theRN41 and RN42 modules, respectively. Theboards have theflexibilityto
connect directlyto PCs via a standard USB interface (via theFTDI chipset)or to embedded
processors through theTTL UART interface. Thestatus LEDs, dipswitches,and signal
headers enable rapidprototyping andintegrationinto existing systems.You configure and
controlthe modules from a console with a simple ASCII command language.Once the
configurationis set up, themodule can connect over Bluetooth.
Evaluationkit is used to configure theBluetooth moduleusing thecommand
interface, create connections, and transfer data.TheRN-41-EK and RN-42-EK evaluation
boards support theserial port profile(SPP) and human interface device (HID)profiles. The
evaluationkit includes:
a. Evaluationboardcontains theBluetooth module,statusLEDs, and
dipswitches.
b. Mini-USB cableLinks your computer to theevaluation board.
Hardware Details 9
Roving Networks Bluetooth devicescan be programmed over the Bluetooth linkor
through theserial interface (USB port)using a simple ASCII command language, which is
similar to theindustry standard Hayes AT protocol.
PIN-OUT
COMMAND MODE V/S DATA MODE
The Bluetooth deviceoperatesin two modes: datamode (default)and command
mode. Uponpower up thedevice is in datamode. Whilein datamode, themodule is
Hardware Details 10
essentially a datapipe.When themodule receives datafrom a remoteBluetooth device
over a serial port profile(SPP) connection, it strips theBluetooth headersandtrailers and
passes theuser datato theUART.
When datais written to theUART, themodule constructs theBluetooth packet and
sends it out over theBluetooth SPPconnection. Thus, theentire process of
sending/receiving datato thehost is transparent to theend microprocessor.
The default configurationfor theBluetooth deviceis:
 Bluetooth SlaveMode
 Keyboarddefault authenticationmode(no pin code required)
o Serial port
o 115,200 Kbps BaudRate
o 8 bits Data
o No Parity
o 1 Stop Bit
 Serial port flow controldisabled
 Low power mode off
Hardware Details 11
LPC1830 XPLORER BOARD
INTRODUCTION
LPC1830-Xplorer has been developed in partnership with NXP semiconductors Inc.
It is a compact and versatile evaluation platformfor theNXP's Cortex-M3 based MCUS.
BOARD FEATURES
 Dimensions: 86mm X 40mm
 Controller: LPC1830, 100 pin BGA
 PCB: 4-layer (RoHScomplaint)
 Two LEDs
 One user switch and one reset switch
 Boot select switch
 32Mb Quad flash
 On boardcrystals for controller, RTC and audio codec
 On boardEthernet PHY, 50 MHz Oscillatorand RJ45 connector with magnetics
 On boardaudio codecand audio jacks
Hardware Details 12
 On boardUSB host power switch
 Two USB ports, one HS (High speed)port and one FS (Full Speed)port
 10-pin cortex debug header
 The board is shipped with two USB cables, one USB device cable and one USB host
adaptercable
 Unused I/Os brought to a header.
BLOCK DIAGRAM
SETUP FOR NXP LPCLINK AND LPC1830 XPLORER BOARD
To run thecodefollowing components are provided:
 NXP LPC-Link2
 10-pin ribboncable
 LPC1830 Xplorer Board
 One USB AM to Micro B cable
 One USB typemini B
Hardware Details 13
STEPS TO SETUP THE LPC-LINK AND LPC1830 XPLORER BOARD
STEP 1:
Connect one end of 10-pin ribbon cable to ‘LPCLink 10-pin connector’; the 10-pin
ribbon cable header notch should facing towards the ‘NXP LPCLink2’ mark as shown in the
following image.
STEP 2:
Connect other end of 10-pin ribbon cable to ‘10-pin box header’ of the LPC1830
Xplorer board and connect one end of ‘USB AM to Micro B’ cable to LPC1830 Xplorer board
and other end to computer, then connect one end of ‘USB type mini B’ to LPCLink2 and
otherend to computer.
STEP 3:
The setup is now ready to be used for development with LPCXpresso and NXP
LPCLink2.
Software Details 14
SOFTWARE DETAILS
LPCXPRESSO
LPCXpresso is a low-cost development tool platform, available directly from NXP,
that provides a quick way to develop advanced applications using NXP’s highly efficient and
low-power LPC microcontrollers. It includes everything to take end users from evaluation
to final production.
FEATURES
 Low-cost development toolplatformfor LPC MCUs
 Eclipse-based IDE
 Low-cost target board
 Integrated debug probe(separate debug probenot required)
 End-to-end solutionsupports evaluation to production
 Free Edition supports code sizes up to 256 kb after activation and can be upgraded
to unlimited codesize by purchasing a Pro Editionlicense
 SupportsC++ applicationandlibraryprojects
 Instruction Trace support
 Red State state machine editor and code generator supports software state
machines, plus statemachines for theStateConfigurable Timer (SCT) peripheral
Software Details 15
LPCXpresso's IDE is a highly-integrated software development environment for
NXP's LPC microcontrollers, which includes all the tools necessary to develop high-quality
software solutions in a timely and cost effective manner. LPCXpresso is based on Eclipse
with many LPC-specific enhancements. It also features the latest version of the industry
standard GNU tool chain with a proprietary optimized C library providing professional
qualitytoolsat low cost.
DEVELOPMENT BOARDS
The LPCXpresso target boards include an integrated JTAG debugger, so there's no
need for a separate JTAG debug probe. The target portion of the board can connect to
expansion boards to provide a variety of interfaces and I/O devices. The on-board JTAG
debugger provides a high-speed USB to JTAG/SWD interface to the IDE, and it can be
connected to other debug targets such as a customer prototype. Users can also use the
LPCXpresso IDE with the LPC-Link2 debug probe, Segger J-link, or any probe supporting
CMSIS-DAP.
Software Details 16
LPC-LINK AND LPC-LINK2
The JTAG/SWD debugger portion of an LPCXpresso board is called the LPC-Link, or
LPC-Link2 on version 2 boards. The LPC-Link is equipped with a 10-pin JTAG header, and it
seamlessly connects to a target via USB (the USB interface and other debug features are
provided by an NXP MCU on board). On the original LPC-Link the traces between the LPC-
link and the target can be cut to make the LPC-Link a stand-alone JTAG debugger. On the
version 2 LPCXpresso boards it can be done with a simple jumper setting. This enables the
LPCXpresso platform to be connected to an external target and used to develop for a wide
variety of NXP's Cortex-M0, Cortex-M3, and Cortex-M4 based applications.
Software Details 17
ANDROID DEVELOPER TOOLS (ADT)
ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of tools
that are integrated with the Eclipse IDE. It offers you access too many features that help
you develop Android applications quickly. ADT provides GUI access to many of the
command line SDK tools as well as a UI design tool for rapid prototyping, designing, and
building of your application'suser interface.
Because ADT is a plugin for Eclipse, you get the functionality of a well-established
IDE, along with Android-specific features that are bundled with ADT. The following
describes important features of Eclipseand ADT:
INTEGRATED ANDROID PROJECT CREATION, BUILDING, PACKAGING, INSTALLATION, AND
DEBUGGING
ADT integrates many development workflow tasks into Eclipse, making it easy for
you to rapidlydevelop andtest your Android applications.
SDK TOOLS INTEGRATION
Many of the SDK tools are integrated into Eclipse's menus, perspectives, or as a part
of backgroundprocesses ran byADT.
Software Details 18
JAVA PROGRAMMING LANGUAGE AND XML EDITORS
The Java programming language editor contains common IDE features such as
compile time syntax checking, auto-completion, and integrated documentation for the
Android framework APIs. ADT also provides custom XML editors that let you edit Android-
specific XML files in a form-based UI. A graphical layout editor lets you design user
interfaces with a drag and drop interface.
Software Details 19
SDK TOOLS INTEGRATION
Many of the tools that you can start or run from the command line are integrated
into ADT. Theyinclude:
 Traceview: Allows you to profile your program's execution (Window > Open
Perspective > Traceview).
 Android: Provides access to the Android SDK Manager and AVD Manager. Other
android features such as creating or updating projects (application and library) are
integrated throughout theEclipseIDE.
 Hierarchy Viewer: Allows you to visualize your application's view hierarchy to find
inefficiencies (Window> Open Perspective > Hierarchy Viewer).
 Pixel Perfect: Allows you to closely examine your UI to help with designing and
building.(Window > Open Perspective > Pixel Perfect).
 DDMS: Provides debugging features including: screen capturing, thread and heap
information, and logcat (Window> OpenPerspective > DDMS).
 adb: Provides access to a device from your development system. Some features of
adb are integrated into ADT such as project installation (Eclipse run menu), file
transfer, device enumeration, and logcat (DDMS). You must access the more
advanced features ofadb, such as shellcommands, from thecommand line.
 ProGuard: Allows code obfuscation, shrinking, and optimization. ADT integrates
ProGuard as part of thebuild,if you enable it.
Bluetooth Technology 20
BLUETOOTH TECHNOLOGY
Bluetooth technology is a wireless communications technology that is simple,
secure, and everywhere. You can find it in billions of devices ranging from mobile phones
and computers to medical devices and home entertainment products. It is intended to
replace thecables connecting devices, whilemaintaining high levels of security.
The key features of Bluetooth technology are ubiquitousness, low power, and low
cost. The Bluetooth Specification defines a uniform structure for a wide range of devices to
connect and communicate with each other.
A fundamental strength of Bluetooth wireless technology is the ability to
simultaneously handle data and voice transmissions. which provides users with a variety of
innovative solutions such as hands-free headsets for voice calls, printing and fax
capabilities,andsynchronization for PCs and mobilephones, just to name a few.
BLUETOOTH CORE SPECIFICATION
Unlike other wireless standards, the Bluetooth Core Specification provides product
developers both link layer and application layer definitions, which support data and voice
applications.
Bluetooth Technology 21
SPECTRUM
Bluetooth technology operates in the unlicensed industrial, scientific and medical
(ISM) band at 2.4 to 2.485 GHz, using a spread spectrum, frequency hopping, full-duplex
signal at a nominal rate of 1600 hops/sec. The 2.4 GHz ISM band is available and unlicensed
in most countries.
INTERFERENCE
Bluetooth technology's adaptive frequency hopping (AFH) capability was designed
to reduce interference between wireless technologies sharing the 2.4 GHz spectrum. AFH
works within the spectrum to take advantage of the available frequency. This is done by the
technology detecting other devices in the spectrum and avoiding the frequencies they are
using. This adaptive hopping among 79 frequencies at 1 MHz intervals gives a high degree
of interference immunity and also allows for more efficient transmission within the
spectrum. For users of Bluetooth technology this hopping provides greater performance
even when other technologiesarebeing used along with Bluetooth technology.
RANGE
The range of Bluetooth technology is application specific. The Core Specification
mandates a minimum range of 10 meters or 30 feet, but there is no set limit and
manufacturers can tune their implementations to provide the range needed to support the
use cases for theirsolutions.
Range is application specific and although a minimum range is mandated by the
Core Specification, there is not a limit and manufacturers can tune their implementation to
support the use case theyare enabling.
Range may vary depending on class ofradio used in an implementation:
 Class 3 radios– have a range ofup to 1 meter or 3 feet
 Class 2 radios – most commonly found in mobile devices – have a range of 10
meters or 33 feet
 Class 1 radios – used primarily in industrial use cases – have a range of 100
meters or 300 feet.
Bluetooth Technology 22
POWER
The most commonly used radio is Class 2 and uses 2.5 mW of power. Bluetooth
technology is designed to have very low power consumption. This is reinforced in the
specificationbyallowing radios to be powered down when inactive.
The Generic Alternate MAC/PHY in Version 3.0 HS enables the discovery of remote
AMPs for high speed devices and turns on the radio only when needed for data transfer
giving a poweroptimizationbenefit as well as aiding in thesecurity ofthe radios.
Bluetooth low energy technology, optimized for devices requiring maximum battery
life instead of a high data transfer rate, consumes between 1/2 and 1/100 the power of
classic Bluetooth technology.
Architecture
Bluetooth definestwo types of networks: Piconet and scatternet.
PICONET
A Bluetooth network is called a piconet, or a small net. A piconet can have up to
eight stations, one of which is called the primary; rest is called secondary. All the secondary
stations synchronize their clocksand hopping sequence with the primary.
Bluetooth Technology 23
Although a piconet can have a maximum of seven secondaries, an additional eighth
secondary can be in parked state. A secondary in parked state is synchronized with the
primary, but cannot take part in communication until it is moved from the parked state.
Because only eight stations can be active in a piconet, activating a station from parked
state means that an active station must go to the parked state. Piconets are established
dynamically and automatically as Bluetooth enabled devices enter and leave radio
proximity meaning that you can easily connect whenever and wherever it's convenient for
you.
SCATTERNET
Piconet can be combined to form what is called a scatternet. A secondary station in
one piconet can be the primary in another piconet. This station can receive messages from
the primary in the first piconet (as a secondary) and, acting as a primary, deliver them to
secondaries in thesecond piconet. A stationcan bemember of two piconets.
Bluetooth Profiles
To use Bluetooth wireless technology, a device must be able to interpret certain
Bluetooth profiles. Bluetooth profiles are definitions of possible applications and specify
general behaviors that Bluetooth enabled devices use to communicate with other
Bluetooth devices. There is a wide range of Bluetooth profiles describing many different
types of applications or use cases for devices. By following the guidance provided by the
Bluetooth Technology 24
Bluetooth specification, developers can create applications to work with other Bluetooth
devices. At a minimum, each Bluetooth profile contains information on the following
topics:
 Dependencies on otherprofiles, Suggested user interface formats
 Specific parts of the Bluetooth protocol stack used by the profile. To perform
its task, each profile uses particular options and parameters at each layer of
the stack and this may include, if appropriate, an outline of the required
service record
GATT BASED
GATT Based Description
ANP Alert Notification
Profile
enables a client device to receive different types of
alerts and event information, as well as information on
the count of new alerts and unread items, which exist in
theserver device.
ANS Alert Notification
Service
exposes different types of alerts.
BAS BatteryService exposes the stateof a batterywithina device.
BLP BloodPressure Profile enables a device to connect and interact with a Blood
Pressure Sensor device for use in consumer and
professional health care applications.
BLS BloodPressure Service exposes blood pressure and other data from a blood
pressure monitor for use in consumer and professional
healthcareapplications.
CTS Current Time Service defines how the current time can be exposed using the
Generic AttributeProfile (GATT).
DIS Device Information
Service
exposes manufacturer information about a device.
FMP Find Me Profile defines the behavior when a button is pressed on one
device to cause an alerting signal on a peer device.
HTP Health Thermometer
Profile
enables a Collector device to connect and interact with
a Thermometer sensor for use in healthcare
applications.
HRP Heart Rate Profile enables a Collector device to connect and interact with
a Heart Rate Sensor for use in fitness applications.
HRS Heart Rate Service exposes heart rate and other data from a Heart Rate
Sensor intended for fitness applications.
HIDS HID Service exposes HID reports and other HID data intended for
HID Hostsand HIDDevices.
Bluetooth Technology 25
HOGP HID Over GATT Profile defines how a device with Bluetooth low energy
wireless communications can support HID services over
the Bluetooth low energy protocol stack using the
Generic AttributeProfile.
IAS ImmediateAlert
Service
exposes a control point to allow a peer device to cause
thedevice to immediatelyalert.
LLS Link Loss Service defines behavior when a link is lost between two
devices.
NDCS Next DST Change
Service
defines how the information about an upcoming DST
change can be exposed using the Generic Attribute
Profile (GATT).
PASP Phone Alert Status
Profile
enables a PUID device to alert its user about the alert
status of a phoneconnected to the PUIDdevice.
PASS Phone Alert Status
Service
exposes the phonealert status when in a connection.
PXP ProximityProfile enables proximitymonitoring between two devices.
RTUS Reference Time
UpdateService
defines how a client can request an update from a
reference time source from a time server using the
Generic AttributeProfile (GATT).
ScPP Scan Parameters
Profile
defines how a Scan Client device with Bluetooth low
energy wireless communications can write its scanning
behavior to a Scan Server, and how a Scan Server can
request updates ofa Scan Client scanning behavior.
ScPS Scan Parameters
Service
enables a GATT Client to store the LE scan parameters
it is using on a GATT Server device so that the GATT
Server can utilize the information to adjust behavior to
optimize power consumption and/or reconnection
latency.
TIP Time Profile enables the device to get thedate, time, time zone, and
DST information and control the functions related the
time.
TPS Tx Power Service exposes a device's current transmit power level when in
a connection.
BR/EDR PROFILES
BR/EDR Profiles Description
A2DP Advanced Audio
DistributionProfile
describes how stereo quality audio can be streamed
from a media source to a sink.
AVRCP Audio/Video Remote
Control Profile
is designed to provide a standard interface to control
TVs, stereo audio equipment, or other A/V devices. This
profile allows a single remote control (or other device)
Bluetooth Technology 26
to control allA/V equipment to which a user has access.
BIP Basic Imaging Profile defines how an imaging device can be remotely
controlled, how an imaging device may print, and how
an imaging device can transfer images to a storage
device.
BPP Basic Printing Profile allows devices to send text, e-mails, v-cards, images or
otherinformation to printers based on print jobs.
DI Device ID Profile provides additional information above and beyond the
Bluetooth Class of Device and to incorporate the
information into both the Service Discovery Profile
(SDP) record and theEIR response.
DUN Dial-Up Network
Profile
provides a standard to access the Internet and other
dial-up services via Bluetooth technology.
FTP File Transfer Profile defines how folders and files on a server device can be
browsed by a client device.
GAVDP Generic Audio/Video
DistributionProfile
provides the basis for A2DP and VDP, which are the
basis of the systems designed for distributing video and
audio streams using Bluetooth technology.
GOEP Generic Object Profile is used to transfer an object from one device to
another.
HFP Hands-Free Profile HFP describes how a gateway device can be used to
placeand receive calls for a hand-free device.
HCRP Hard CopyCable
Replacement Profile
defines how driver-based printing is accomplished over
a Bluetooth wireless link.
HDP Health DeviceProfile enables Healthcareand Fitness device usage models.
HSP Headset Profile describes how a Bluetooth enabled headset should
communicate with a Bluetooth enabled device.
HID Human Interface
Device Profile
defines the protocols, procedures and features to be
used by Bluetooth keyboards, mice, pointing and
gaming devices and remote monitoring devices.
MAP Message Access
Profile
defines a set of features and procedures to exchange
messages between devices.
MPS Multi Profile defines a set of features and procedures between
Multiple Profiles Single Device and Multiple Profiles
MultipleDevices
OPP Object Push Profile defines the roles of push server and push client.
PBAP Phone BookAccess
Profile
defines the procedures and protocols to exchange
Phone Bookobjectsbetween devices.
PAN Personal Area
Networking Profile
describes how two or more Bluetooth enabled devices
can form an ad-hoc network and how the same
mechanism can be used to access a remote network
through a network access point.
SAP SIM Access Profile defines the protocols and procedures that shall be used
to access a GSM SIM card, a UICC card or an R-UIM card
Bluetooth Technology 27
via a Bluetooth link.
SDAP Service Discovery
ApplicationProfile
describes how an application should use SDP to
discover services on a remote device.
SPP Service Port Profile defines how to set-up virtual serial ports and connect
two Bluetooth enabled devices.
SYNC Synchronization
Profile
used in conjunction with GOEP to enable
synchronization of calendar and address information
(personal information manager (PIM) items) between
Bluetooth enabled devices.
VDP Video Distribution
Profile
defines how a Bluetooth enabled device streams video
over Bluetooth wireless technology.
BR/EDR PROTOCOLS
BR/EDR Protocols Description
AVCTP Audio/Video Control
Transport Protocol
describes the transport mechanisms to exchange
messages for controlling A/V devices.
AVDTP Audio/Video
Distribution
Transport Protocol
defines A/V stream negotiation, establishment and
transmission procedures
BNEP Bluetooth Network
Encapsulation
Protocol
is used to transport common networking protocols
over the Bluetooth mediasuch as IPv4 and IPv6.
IrDA IrDA Interoperability offers the same features for applications as within the
IrDA protocol hierarchy, enabling the applications to
work over the Bluetooth protocol stack as well as the
IrDA stack.
OBEX Object Exchange a transfer protocol that defines data objects and a
communication protocol two devices can use to
exchange thoseobjects.
RFCOMM RFCOMM with TS
07.10
emulates the serial cable line settings and status of an
RS-232 serial port and is used for providing serial data
transfer.
Bluetooth Technology 28
BLUETOOTH LAYERS
BLUETOOTH PROFILE – SPP (SERVICE PORT PROFILE)
SPP defines how to set up virtual serial ports and connect two Bluetooth enabled
devices. A scenario would be using two devices, such as PCs or laptops, as virtual serial
ports and thenconnecting thetwo devices via Bluetooth technology.
The SPP defines two roles, Device A and Device B.
 Device A – This is the device that takes initiative to form a connection to
anotherdevice (initiator).
 Device B – This is the device that waits for another device to take initiative to
connect (acceptor).
Bluetooth Technology 29
The Baseband, LMP and L2CAP are the OSI layer 1 and 2 Bluetooth protocols.
RFCOMM is the Bluetooth adaptation of GSM TS 07.10, providing a transport protocol for
serial port emulation. SDP is the Bluetooth ServiceDiscovery Protocol.
The port emulation layer shown in the figure to the left is the entity emulating the
serial port, or providing an API to applications.
The applications on both sides are typically legacy applications, able and wanting to
communicate over a serial cable (which in this case is emulated). But legacy applications
cannot know about Bluetooth procedures for setting up emulated serial cables, which is
why they need help from some sort of Bluetooth aware helper application on both sides.
(These issues are not explicitly addressed in this profile; the major concern here is for
Bluetooth interoperability.)
SDP (SERVICE DISCOVERY PROTOCOL)
The SDP is used for location of services provided by or available through aBluetooth
device and it facilitatesthefollowing:
 The client’sabilityto search for theservices in thepiconet
 Services to be discovered based on class of services (such as print service)
 The capabilityto browseservices
 To find out when a service becomes unavailable(device goes out of range)
 The discoveryof new services (withinrange)
 The detailsofservices such as classes and attributes
 When a device wants to discover a service the client and the server exchange SDP
messages.
The attributes can be a service class ID list, a service ID, a protocol description, a
provider name, an icon URL, a service name, and a service description.
RFCOMM
RFCOMM is a transport protocol to emulate serial communication (RS232 serial
ports) over L2CAP. Two devices can communicate through RFCOMM over Bluetooth radio.
RFCOMM emulates the nine connections of RS232 such as Request to Send, Transmit Data
and Clear to Send. It supports two types of devices. Type 1 is communication end points
Bluetooth Technology 30
(computers, printers) and type 2 devices are part of a communication segment such as a
modem.
L2CAP (LOGICAL LINK CONTROL AND ADAPTATION PROTOCOL)
The Bluetooth logical link control and adaptation protocol (L2CAP) supports higher-
level protocol multiplexing, packet segmentation and reassembly, and the conveying of
qualityof service information.
L2CAP permits higher level protocols and applications to transmit and receive upper
layer datapackets(L2CAP Service Data Units, SDU) up to 64 kilobytes in length. L2CAP also
permits per-channel flow control and retransmission via the Flow Control and
Retransmission Modes. The L2CAP layer provides logical channels, named L2CAP channels,
which map to L2CAP logicallinkssupported by an ACL logicaltransport
L2CAP is based around the concept of 'channels'. Each one of the endpoints of an
L2CAP channel is referred to by a channel identifier(CID).
CHANNEL IDENTIFIERS
A channel identifier (CID) is the local name representing a logical channel endpoint
on the device. CID assignment is relative to a particular device and a device can assign CIDs
independentlyfrom otherdevices (unless it needs to use any of the several reserved CIDs)
OPERATION BETWEEN DEVICES
The connection oriented data channels represent a connection between two
devices, where a CID identifies each endpoint of the channel. The connectionless channels
restrict data flow to a single direction. These channels are used to support a channel 'group'
where the CID on the source represents one or more remote devices. There are also a
number of CIDs reserved for special purposes. The signaling channel is one example of a
reserved channel. This channel is used to create and establish connection-oriented data
channels and to negotiate changes in the characteristics of connection oriented and
connectionless channels.
Bluetooth Technology 31
MODES OF OPERATION
L2CAP may operate in one of three different modes as selected for each L2CAP
channel by an upper layer. Themodes are:
 Basic L2CAP Mode (equivalent to L2CAP specificationin Bluetooth v1.1)1
 Flow Control Mode
 Retransmission Mode
DATA PACKET FORMAT
L2CAP is packet-based but follows a communication model based on channels. A
channel represents a data flow between L2CAP entities in remote devices. Channels may
be connection-oriented or connectionless.
SIGNALING PACKET FORMATS
This section describes the signaling commands passed between two L2CAP entities
on peer devices. All signaling commands are sent to the signaling channel with CID 0x0001.
This signaling channel is available as soon as an ACL logical transport is set up and L2CAP
traffic is enabled on the L2CAP logical link. Multiple commands may be sent in a single
signaling command (C-frame). Commands take the form of Requests and Responses. All
L2CAP implementations support the reception of C-frames with a payload length that does
not exceed the signaling MTU. The minimum supported payload length for the C-frame
(MTUsig) is 48 octets. L2CAP implementations should not use C-frames that exceed the
MTUsig of the peer device. If they ever do, the peer device shall send a Command Reject
containing the supported MTUsig.
CONFIGURATION PARAMETER OPTIONS
Options are a mechanism to extend the configuration parameters. Options are
transmitted as information elements containing an option type, an option length, and one
or more optiondatafields.
Bluetooth Technology 32
HCI (HOST CONTROLLER INTERFACE)
A Bluetooth device can have two parts: a module implementing the lower layers
(LMP and under) and a software module (L2CAP and over) in the host. The Host Controller
Interface handles communications between a separatehost and a Bluetooth module
The HCI provides an interface so that the two modules can be from different
vendors. The functions ofHCI are:
 Setting up disconnecting, and configuring the links
 Control of basebandfeatures such as timeouts
 Retrieving status information
 Local testing of thehardware module
OVERVIEW OF HCICOMMANDS AND EVENTS
Generic Events The generic events can occur due to multiple commands, or
events that can occur at any time.
Device Setup The device setup commands are used to place the Controller into
a known state.
Controller Flow
Control
The controller flow control commands and events are used to
controldataflow from theHost to thecontroller.
Controller
Information
The controller information commands allow the Host to discover
localinformation about thedevice.
Controller
Configuration
The controller configuration commands and events allow the
globalconfigurationparameters to be configured.
Device Discovery The device discovery commands and events allow a device to
discover otherdevices in thesurrounding area.
Connection Setup The connection setup commands and events allow a device to
make a connection to another device.
Remote Information The remote information commands and events allow information
about a remote device's configuration to be discovered.
Synchronous
Connections
The synchronous connection commands and events allow
synchronous connections to becreated.
Connection State The connection state commands and events allow the
configurationof a link, especiallyfor low power operation.
Piconet Structure The piconet structure commands and events allow the discovery
and reconfiguration ofpiconet.
Quality of Service The quality of service commands and events allow quality of
service parameters to bespecified.
Physical Links The physical link commands and events allow the configuration of
Bluetooth Technology 33
a physicallink.
Host Flow Control The Host flow control commands and events allow flow control to
be used towards theHost.
Link Information The link information commands and events allow information
about a link to be read.
Authentication and
Encryption
The authentication and encryption commands and events allow
authenticationofa remote device and thenencryption of thelink.
LINK MANAGER
The Link Manager controls and configures links to other devices. It translates the
commands into operationsat the Basebandlevel, managing the following operations.
 Attaching slaves to piconets, and allocating theiractivemember addresses.
 Breaking connections to detach Slaves from a piconet.
 Configuring thelink including Master/Slave switches
 Establishing ACL and SCO links.
 Putting connections into Low Power modes: Hold,Sniff and Park.
 Controlling test modes.
BASEBAND LAYER
The Baseband is the physical layer of the Bluetooth. It manages physical channels
and links apart from other services like error correction, data whitening, hop selection and
Bluetooth security. The Baseband layer lies on top of the Bluetooth radio layer in the
bluetooth stack.
The baseband protocol is implemented as a Link Controller, which works with the
link manager for carrying out link level routines like link connection and power control. The
baseband also manages asynchronous and synchronous links, handles packets and does
paging and inquiry to access and inquire Bluetooth devices in the area. The baseband
transceiver applies a time-division duplex (TDD) scheme. (Alternate transmit and receive).
Therefore apart from different hopping frequency (frequency division), the time is also
slotted.
Bluetooth Technology 34
PACKET FORMAT
Each packet consists of 3 entities, the access code (68/72 bits), the header (54
bits), and thepayload(0-2745bits).
ACCESS CODE:
Access codes are used for timing synchronization, offset compensation,
paging and inquiry. There are three different typesof Access code:
1. Channel Access Code (CAC)
2. Device Access Code (DAC)
3. Inquiry Access Code (IAC)
The channel access code identifies a unique piconet while the DAC is used for
paging and its responses. IAC is used for inquiry purpose.
HEADER:
The header contains information for packet acknowledgement, packet
numbering for out-of-order packet reordering, flow control, slave address and error
check for header.
PAYLOAD:
The packet payload can contain either voice field, data field or both. It has a
datafield; thepayloadwillalso contain a payloadheader.
Future Scope 35
FUTURE SCOPE
Getting a light to turn on and off may sound easy and probably even useless. But if
we come to think of it, there’s much more to this project than just this much. The project
can just be modified alittlebit to have real life implementationswhich would do wonders.
Imagine having something similar in the Kitchen. A kitchen area with a LED strip/
lamp placed on top of the stove, preferably as long as the kitchen bench. What if this was
controlled automatically by an Android phone? The phone could be made to automatically
connect to the controller device for the LED strip/lamp, via Bluetooth, & turn on/off the
lamp whenever a person enters/leaves.
Not only that, the device could be made smarter by using an LED strip of light which
changes colors/patterns on receiving phone calls/messages. This would really be an added
advantage as the kitchen is generally a noisy place with the air extractor, microwave,
blender and other appliances used frequently. Some kind of hands free notifications in such
environments wouldsurely be appreciated.
References 36
REFERENCES
1) Bluetooth SIG,SpecificationoftheBluetooth SystemVersion1.0B volume 1, 1999.
http://www.bluetooth.com/developer/specification/core_10_b.pdf.
2) Guo, Y. Philips FM/IF systems for GMSK/GFSK receivers, Philips Semiconductors
1997
http://www.semiconductors.com/acrobat/applicationnotes/AN1997.pdf.
Referred 5/10/2000
3) Markovic, V. Gaussian Minimum Shift Keying. Presentation given in course
“Advanced Course in Digital Transmission” at Tampere University of Technology,
1999
http://www.cs.tut.fi/kurssit/83090/S13.ps. Referred 5/10/2000
4) Oraskari, Jyrki, Bluetooth 2000
http://www.hut.fi/~joraskur/bluetooth.html
5) Specification of the Bluetooth System Wireless connections madeeasy Core
Version 1.1 February 22, 2001.
http://www.ece.virgina.edu/~mmz4s/papers/ECE613project_bluetooth.pdf
6) Wireless Communications Information & Services “Bluetooth Specification;
Bluetooth Technology overview”,
http://www.thewirelessdirectory.com/BluetoothOverview/BluetoothSpecificatio
n.htm.
7) http://www.developer.android.com
8) http://www.nxp.com/LPC-Overview/18xx-series-Specifications.html
9) http://www.lpcware.com/UserManual/LPC1830FET100-Board.htm
10) http://www.ngxtech.com/Support/Starter-LPCXpresso.html

More Related Content

What's hot

Smart grid technology
Smart grid technologySmart grid technology
Smart grid technologyAng Sovann
 
Artificial intelligence in power system
Artificial intelligence in power systemArtificial intelligence in power system
Artificial intelligence in power systemBittu Goswami
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorEdgefxkits & Solutions
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation projectShohin Aheleroff
 
Power system automation pdf
Power system automation pdfPower system automation pdf
Power system automation pdfPawan Sharma
 
Power system automation
Power system automationPower system automation
Power system automationAbbas Ali
 
Artificial Intelligence in Power Systems
Artificial Intelligence in Power SystemsArtificial Intelligence in Power Systems
Artificial Intelligence in Power SystemsSowmya T
 
Industrial monitoring and control systems using andriod application
Industrial monitoring and control systems using andriod applicationIndustrial monitoring and control systems using andriod application
Industrial monitoring and control systems using andriod applicationAvinash Vemula
 
AUTOMATIC RAILWAY GATE CONTROL SYSTEM
AUTOMATIC RAILWAY GATE CONTROL SYSTEMAUTOMATIC RAILWAY GATE CONTROL SYSTEM
AUTOMATIC RAILWAY GATE CONTROL SYSTEMJOLLUSUDARSHANREDDY
 
smart grid seminar report
smart grid seminar reportsmart grid seminar report
smart grid seminar reportramesh kumawat
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by BluetoothAakashkumar276
 
Power theft detection
Power theft detectionPower theft detection
Power theft detectionAravind Shaji
 
PPT ON 33/11KV SUBSTATION
PPT ON 33/11KV SUBSTATIONPPT ON 33/11KV SUBSTATION
PPT ON 33/11KV SUBSTATIONRavi Phadtare
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
 

What's hot (20)

Smart grid technology
Smart grid technologySmart grid technology
Smart grid technology
 
Artificial intelligence in power system
Artificial intelligence in power systemArtificial intelligence in power system
Artificial intelligence in power system
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulator
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation project
 
Power system automation pdf
Power system automation pdfPower system automation pdf
Power system automation pdf
 
Power system automation
Power system automationPower system automation
Power system automation
 
Artificial Intelligence in Power Systems
Artificial Intelligence in Power SystemsArtificial Intelligence in Power Systems
Artificial Intelligence in Power Systems
 
Gauss seidel method
Gauss seidel methodGauss seidel method
Gauss seidel method
 
Industrial monitoring and control systems using andriod application
Industrial monitoring and control systems using andriod applicationIndustrial monitoring and control systems using andriod application
Industrial monitoring and control systems using andriod application
 
Solar tracker ppt
Solar tracker pptSolar tracker ppt
Solar tracker ppt
 
AUTOMATIC RAILWAY GATE CONTROL SYSTEM
AUTOMATIC RAILWAY GATE CONTROL SYSTEMAUTOMATIC RAILWAY GATE CONTROL SYSTEM
AUTOMATIC RAILWAY GATE CONTROL SYSTEM
 
smart grid seminar report
smart grid seminar reportsmart grid seminar report
smart grid seminar report
 
Solar tree ppt
Solar tree pptSolar tree ppt
Solar tree ppt
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by Bluetooth
 
Power theft detection
Power theft detectionPower theft detection
Power theft detection
 
PPT ON 33/11KV SUBSTATION
PPT ON 33/11KV SUBSTATIONPPT ON 33/11KV SUBSTATION
PPT ON 33/11KV SUBSTATION
 
Plc report
Plc reportPlc report
Plc report
 
Smart grid
Smart gridSmart grid
Smart grid
 
Smart Grid Technology
Smart Grid TechnologySmart Grid Technology
Smart Grid Technology
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontroller
 

Similar to Project Report - Lighting Control via Bluetooth using Android

Embedded system - Introduction to interfacing with peripherals
Embedded system - Introduction to interfacing with peripheralsEmbedded system - Introduction to interfacing with peripherals
Embedded system - Introduction to interfacing with peripheralsVibrant Technologies & Computers
 
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS ToolsCodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Toolsdjerrybellott
 
Uart driver nov13
Uart driver nov13Uart driver nov13
Uart driver nov13abinaya m
 
Computer organization
Computer organizationComputer organization
Computer organizationRvishnupriya2
 
Computer organization
Computer organization Computer organization
Computer organization vishnu973656
 
Ptcl modem (user manual)
Ptcl modem (user manual)Ptcl modem (user manual)
Ptcl modem (user manual)Ali Usman
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxRuhul Amin
 
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...Design and Implementing Novel Independent Real-Time Software Programmable DAQ...
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...Editor IJCATR
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfaptinstallpython3
 
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for ArduinoRaghav Shetty
 
TEMPERATURE MONITORING
TEMPERATURE MONITORINGTEMPERATURE MONITORING
TEMPERATURE MONITORINGManisha Chandu
 
Mini PHYTER® 10/100 Ethernet Transceivers
Mini PHYTER® 10/100 Ethernet TransceiversMini PHYTER® 10/100 Ethernet Transceivers
Mini PHYTER® 10/100 Ethernet TransceiversPremier Farnell
 
Module 5 embedded systems,8051
Module 5 embedded systems,8051Module 5 embedded systems,8051
Module 5 embedded systems,8051Deepak John
 

Similar to Project Report - Lighting Control via Bluetooth using Android (20)

Embedded system - Introduction to interfacing with peripherals
Embedded system - Introduction to interfacing with peripheralsEmbedded system - Introduction to interfacing with peripherals
Embedded system - Introduction to interfacing with peripherals
 
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS ToolsCodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
 
H n q & a
H n q & aH n q & a
H n q & a
 
Uart driver nov13
Uart driver nov13Uart driver nov13
Uart driver nov13
 
NAVEEN UART BATCH 43
NAVEEN UART BATCH 43NAVEEN UART BATCH 43
NAVEEN UART BATCH 43
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Computer organization
Computer organization Computer organization
Computer organization
 
Ptcl modem (user manual)
Ptcl modem (user manual)Ptcl modem (user manual)
Ptcl modem (user manual)
 
Ptcl Modem User Manual
Ptcl Modem User Manual Ptcl Modem User Manual
Ptcl Modem User Manual
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptx
 
Io pro
Io proIo pro
Io pro
 
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...Design and Implementing Novel Independent Real-Time Software Programmable DAQ...
Design and Implementing Novel Independent Real-Time Software Programmable DAQ...
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdf
 
Ch09
Ch09Ch09
Ch09
 
I/O System
I/O SystemI/O System
I/O System
 
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
 
TEMPERATURE MONITORING
TEMPERATURE MONITORINGTEMPERATURE MONITORING
TEMPERATURE MONITORING
 
Mini PHYTER® 10/100 Ethernet Transceivers
Mini PHYTER® 10/100 Ethernet TransceiversMini PHYTER® 10/100 Ethernet Transceivers
Mini PHYTER® 10/100 Ethernet Transceivers
 
Io pro
Io proIo pro
Io pro
 
Module 5 embedded systems,8051
Module 5 embedded systems,8051Module 5 embedded systems,8051
Module 5 embedded systems,8051
 

Project Report - Lighting Control via Bluetooth using Android

  • 1. TABLE OF CONTENTS Hardware Used ..........................................................................................................................3 Softwares Used..........................................................................................................................3 Control Flow ..............................................................................................................................4 Bluetooth Module..................................................................................................................4 LPC Xplorer Board .................................................................................................................4 Android Application...............................................................................................................5 UART Interfacing ...................................................................................................................6 Hardware Details.......................................................................................................................8 Roving Network Bluetooth Module (rn41-ek).......................................................................8 Pin-out ................................................................................................................................9 Command Mode v/s Data Mode........................................................................................9 LPC1830 Xplorer Board........................................................................................................ 11 Introduction...................................................................................................................... 11 Board Features ................................................................................................................. 11 Block Diagram..................................................................................................................12 Setup for NXP LPCLink and LPC1830 Xplorer Board ......................................................12 Steps to setup the LPC-Link and LPC1830 Xplorer Board .............................................. 13 Software Details......................................................................................................................14 LPCXpresso ..........................................................................................................................14 Features............................................................................................................................14 Development Boards .......................................................................................................15 LPC-Link and LPC-Link2 ..................................................................................................16 Android Developer Tools (ADT).......................................................................................... 17 Integrated Android project creation, building, packaging, installation, and debugging17 SDK Tools integration...................................................................................................... 17 Java programming language and XML editors................................................................18 SDK Tools Integration......................................................................................................19 Bluetooth Technology.............................................................................................................20 Bluetooth Core Specification ..............................................................................................20
  • 2. TableOf Contents 2 Spectrum..........................................................................................................................21 Interference ......................................................................................................................21 Range................................................................................................................................21 Power................................................................................................................................22 Piconet..............................................................................................................................22 Scatternet.........................................................................................................................23 GATT Based......................................................................................................................24 BR/EDR Profiles................................................................................................................25 BR/EDR Protocols.............................................................................................................27 Bluetooth Layers..................................................................................................................28 Bluetooth Profile – SPP (Service Port Profile).................................................................28 SDP (Service Discovery Protocol)....................................................................................29 RFCOMM ..........................................................................................................................29 L2CAP (Logical Link Control and Adaptation Protocol) .................................................30 HCI (Host Controller Interface) ........................................................................................32 Link Manager.................................................................................................................... 33 Baseband Layer................................................................................................................ 33 Future Scope............................................................................................................................35 References ...............................................................................................................................36
  • 3. Hardware Used 3 HARDWARE USED 1. Bluetooth Module:Roving Networks rn 41-ek 2. Base Board:LPC1830 Xplorer Board 3. Program flash/Debugger: LPC Link 2 4. Cables for connection:  Single pin female headers for connection between Bluetooth module and base board.  One USB to mini B for serial datatransfer to LPC link 2.  One mini USB for powering up of base board SOFTWARES USED 1. LPC Xpresso 2. Android Development Tool(ADT)
  • 4. Control Flow 4 CONTROL FLOW BLUETOOTH MODULE 1. Configured in Slave Mode whereby other Bluetooth devices can discover and connect to the module. 2. The serial port settings are set to: a. Baudrate 115,200 b. 8 bits c. No Parity d. 1 stop bit e. Hardware flow control enabled 3. Acts as a gatewaypassing datato/from theUART LPC XPLORER BOARD 1. Configures theBluetooth module 2. Sends and receives datafrom UART 3. Decodescommands received to controltheLEDS
  • 5. Control Flow 5 ANDROID APPLICATION The androidapplicationhasthefollowing features:- 1. Menu Items a. Turn Bluetooth On b. Turn Off Bluetooth c. Connect to Remote Device  Shows list ofPaired Devices to select from  Also Scans for New Devices d. Disconnect theConnection 2. Connection Status a. Gives the status of whetherconnection was established successfully or not. 3. Switches a. To controltheturning on and off of different LEDS Program code for the Android Application is provided separately in CD.
  • 6. Control Flow 6 UART INTERFACING A universal asynchronous receiver/transmitter, abbreviated UART, is a piece of computer hardware that translates data between parallel and serial forms. UARTs are commonly used in conjunction with communication standards such as EIA, RS-232, RS-422 or RS-485. The universal designation indicates that the data format and transmission speeds are configurable. The electric signaling levels and methods (such as differential signaling etc.) are handled by a driver circuit external to theUART. A UART usually contains the following components:  a clockgenerator, usually a multipleofthebit rateto allowsampling in themiddleof a bit period.  input and output shift registers  transmit/receive control  read/write control logic  transmit/receive buffers (optional)  paralleldatabus buffer (optional)  First-in, first-out (FIFO) buffer memory (optional) LPC1830 includes four 550 UARTs with DMA support: one UART with full modem interface; one UART with IrDA interface; threeUSARTs support synchronous mode and a smart card interface conforming to ISO7816 specification. Descriptionof 550 UARTs: This UART has 16-byte FIFO buffers. Its receive interrupt trigger levels can be set to 1, 4, 8, or 14 characters. Its maximum standard serial port speed if the operating system has a 1 millisecond interrupt latency is 115.2 Kbit/s. Operating systems with lower interrupt latencies could handle higher baud rates like 230.4 Kbit/s or 460.8 Kbit/s. This chip can provide signals to facilitate a third party DMA controller perform DMA transfers to and from the UART. This was known as DMA mode because it was meant to be coupled with a DMA controller in this mode to perform the transfers on behalf of the CPU. It was introduced by National Semiconductor, which has been sold to Texas Instruments. National Semiconductorclaimed that thisUART could physicallyrun at up to 1.5 Mbit/s.
  • 7. Control Flow 7 UART coding In the project UART of the base board is configured for receive mode. It works in a continuous polling mode. Configurationof UART is:  Dataflow rate= 9600bps  Datalength=8 databit  Parity= None  Stop bit=1  No flow control  Receive enable Program code for the UART transmission is provided separately in CD. Descriptionabout coding:  Firstly theUART is configured to function according to user need. As theboard has to receive dataonlytherefore onlyreceive modeis enabled. UART_Init ((LPC_USARTn_Type*) DEBUG_UART_PORT, &UARTConfigStruct);  As LPC1830 pins are multifunctional,therefore, thepins that provideUART functionalityare configures as Rx and Tx pins. scu_pinmux (0x6, 5, MD_PDN|MD_EZI, FUNC2);  UART Rx FIFO buffer is initialized to receive datasent by Bluetooth module. UART_FIFOConfigStructInit (&UARTFIFOConfigStruct);  After that thecode runs in a whileloop where it waits for thecharacter received and after receiving a character it is compared with thepredefined character which on success turns on/off theLEDs of thebase board.  The receive methodson successfully receiving thecharacter returns thenumber of bytessent which is used as a counter for inner loop. len = UART_Receive ((LPC_USARTn_Type*) DEBUG_UART_PORT, buffer, sizeof(buffer), NONE_BLOCKING);  After the end of main method thereis checkfail methodwhich is used for debugging. Inside this methoduser can addhis own implementationto report the filename and line number. Ex: printf ("Wrongparameters value: file %s on line %drn", file, line)
  • 8. Hardware Details 8 HARDWARE DETAILS ROVING NETWORK BLUETOOTH MODULE (RN41-EK) The RN-41-EK evaluationboard is field-ready,Bluetooth SIGqualified prototyping platforms for theRN41 and RN42 modules, respectively. Theboards have theflexibilityto connect directlyto PCs via a standard USB interface (via theFTDI chipset)or to embedded processors through theTTL UART interface. Thestatus LEDs, dipswitches,and signal headers enable rapidprototyping andintegrationinto existing systems.You configure and controlthe modules from a console with a simple ASCII command language.Once the configurationis set up, themodule can connect over Bluetooth. Evaluationkit is used to configure theBluetooth moduleusing thecommand interface, create connections, and transfer data.TheRN-41-EK and RN-42-EK evaluation boards support theserial port profile(SPP) and human interface device (HID)profiles. The evaluationkit includes: a. Evaluationboardcontains theBluetooth module,statusLEDs, and dipswitches. b. Mini-USB cableLinks your computer to theevaluation board.
  • 9. Hardware Details 9 Roving Networks Bluetooth devicescan be programmed over the Bluetooth linkor through theserial interface (USB port)using a simple ASCII command language, which is similar to theindustry standard Hayes AT protocol. PIN-OUT COMMAND MODE V/S DATA MODE The Bluetooth deviceoperatesin two modes: datamode (default)and command mode. Uponpower up thedevice is in datamode. Whilein datamode, themodule is
  • 10. Hardware Details 10 essentially a datapipe.When themodule receives datafrom a remoteBluetooth device over a serial port profile(SPP) connection, it strips theBluetooth headersandtrailers and passes theuser datato theUART. When datais written to theUART, themodule constructs theBluetooth packet and sends it out over theBluetooth SPPconnection. Thus, theentire process of sending/receiving datato thehost is transparent to theend microprocessor. The default configurationfor theBluetooth deviceis:  Bluetooth SlaveMode  Keyboarddefault authenticationmode(no pin code required) o Serial port o 115,200 Kbps BaudRate o 8 bits Data o No Parity o 1 Stop Bit  Serial port flow controldisabled  Low power mode off
  • 11. Hardware Details 11 LPC1830 XPLORER BOARD INTRODUCTION LPC1830-Xplorer has been developed in partnership with NXP semiconductors Inc. It is a compact and versatile evaluation platformfor theNXP's Cortex-M3 based MCUS. BOARD FEATURES  Dimensions: 86mm X 40mm  Controller: LPC1830, 100 pin BGA  PCB: 4-layer (RoHScomplaint)  Two LEDs  One user switch and one reset switch  Boot select switch  32Mb Quad flash  On boardcrystals for controller, RTC and audio codec  On boardEthernet PHY, 50 MHz Oscillatorand RJ45 connector with magnetics  On boardaudio codecand audio jacks
  • 12. Hardware Details 12  On boardUSB host power switch  Two USB ports, one HS (High speed)port and one FS (Full Speed)port  10-pin cortex debug header  The board is shipped with two USB cables, one USB device cable and one USB host adaptercable  Unused I/Os brought to a header. BLOCK DIAGRAM SETUP FOR NXP LPCLINK AND LPC1830 XPLORER BOARD To run thecodefollowing components are provided:  NXP LPC-Link2  10-pin ribboncable  LPC1830 Xplorer Board  One USB AM to Micro B cable  One USB typemini B
  • 13. Hardware Details 13 STEPS TO SETUP THE LPC-LINK AND LPC1830 XPLORER BOARD STEP 1: Connect one end of 10-pin ribbon cable to ‘LPCLink 10-pin connector’; the 10-pin ribbon cable header notch should facing towards the ‘NXP LPCLink2’ mark as shown in the following image. STEP 2: Connect other end of 10-pin ribbon cable to ‘10-pin box header’ of the LPC1830 Xplorer board and connect one end of ‘USB AM to Micro B’ cable to LPC1830 Xplorer board and other end to computer, then connect one end of ‘USB type mini B’ to LPCLink2 and otherend to computer. STEP 3: The setup is now ready to be used for development with LPCXpresso and NXP LPCLink2.
  • 14. Software Details 14 SOFTWARE DETAILS LPCXPRESSO LPCXpresso is a low-cost development tool platform, available directly from NXP, that provides a quick way to develop advanced applications using NXP’s highly efficient and low-power LPC microcontrollers. It includes everything to take end users from evaluation to final production. FEATURES  Low-cost development toolplatformfor LPC MCUs  Eclipse-based IDE  Low-cost target board  Integrated debug probe(separate debug probenot required)  End-to-end solutionsupports evaluation to production  Free Edition supports code sizes up to 256 kb after activation and can be upgraded to unlimited codesize by purchasing a Pro Editionlicense  SupportsC++ applicationandlibraryprojects  Instruction Trace support  Red State state machine editor and code generator supports software state machines, plus statemachines for theStateConfigurable Timer (SCT) peripheral
  • 15. Software Details 15 LPCXpresso's IDE is a highly-integrated software development environment for NXP's LPC microcontrollers, which includes all the tools necessary to develop high-quality software solutions in a timely and cost effective manner. LPCXpresso is based on Eclipse with many LPC-specific enhancements. It also features the latest version of the industry standard GNU tool chain with a proprietary optimized C library providing professional qualitytoolsat low cost. DEVELOPMENT BOARDS The LPCXpresso target boards include an integrated JTAG debugger, so there's no need for a separate JTAG debug probe. The target portion of the board can connect to expansion boards to provide a variety of interfaces and I/O devices. The on-board JTAG debugger provides a high-speed USB to JTAG/SWD interface to the IDE, and it can be connected to other debug targets such as a customer prototype. Users can also use the LPCXpresso IDE with the LPC-Link2 debug probe, Segger J-link, or any probe supporting CMSIS-DAP.
  • 16. Software Details 16 LPC-LINK AND LPC-LINK2 The JTAG/SWD debugger portion of an LPCXpresso board is called the LPC-Link, or LPC-Link2 on version 2 boards. The LPC-Link is equipped with a 10-pin JTAG header, and it seamlessly connects to a target via USB (the USB interface and other debug features are provided by an NXP MCU on board). On the original LPC-Link the traces between the LPC- link and the target can be cut to make the LPC-Link a stand-alone JTAG debugger. On the version 2 LPCXpresso boards it can be done with a simple jumper setting. This enables the LPCXpresso platform to be connected to an external target and used to develop for a wide variety of NXP's Cortex-M0, Cortex-M3, and Cortex-M4 based applications.
  • 17. Software Details 17 ANDROID DEVELOPER TOOLS (ADT) ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of tools that are integrated with the Eclipse IDE. It offers you access too many features that help you develop Android applications quickly. ADT provides GUI access to many of the command line SDK tools as well as a UI design tool for rapid prototyping, designing, and building of your application'suser interface. Because ADT is a plugin for Eclipse, you get the functionality of a well-established IDE, along with Android-specific features that are bundled with ADT. The following describes important features of Eclipseand ADT: INTEGRATED ANDROID PROJECT CREATION, BUILDING, PACKAGING, INSTALLATION, AND DEBUGGING ADT integrates many development workflow tasks into Eclipse, making it easy for you to rapidlydevelop andtest your Android applications. SDK TOOLS INTEGRATION Many of the SDK tools are integrated into Eclipse's menus, perspectives, or as a part of backgroundprocesses ran byADT.
  • 18. Software Details 18 JAVA PROGRAMMING LANGUAGE AND XML EDITORS The Java programming language editor contains common IDE features such as compile time syntax checking, auto-completion, and integrated documentation for the Android framework APIs. ADT also provides custom XML editors that let you edit Android- specific XML files in a form-based UI. A graphical layout editor lets you design user interfaces with a drag and drop interface.
  • 19. Software Details 19 SDK TOOLS INTEGRATION Many of the tools that you can start or run from the command line are integrated into ADT. Theyinclude:  Traceview: Allows you to profile your program's execution (Window > Open Perspective > Traceview).  Android: Provides access to the Android SDK Manager and AVD Manager. Other android features such as creating or updating projects (application and library) are integrated throughout theEclipseIDE.  Hierarchy Viewer: Allows you to visualize your application's view hierarchy to find inefficiencies (Window> Open Perspective > Hierarchy Viewer).  Pixel Perfect: Allows you to closely examine your UI to help with designing and building.(Window > Open Perspective > Pixel Perfect).  DDMS: Provides debugging features including: screen capturing, thread and heap information, and logcat (Window> OpenPerspective > DDMS).  adb: Provides access to a device from your development system. Some features of adb are integrated into ADT such as project installation (Eclipse run menu), file transfer, device enumeration, and logcat (DDMS). You must access the more advanced features ofadb, such as shellcommands, from thecommand line.  ProGuard: Allows code obfuscation, shrinking, and optimization. ADT integrates ProGuard as part of thebuild,if you enable it.
  • 20. Bluetooth Technology 20 BLUETOOTH TECHNOLOGY Bluetooth technology is a wireless communications technology that is simple, secure, and everywhere. You can find it in billions of devices ranging from mobile phones and computers to medical devices and home entertainment products. It is intended to replace thecables connecting devices, whilemaintaining high levels of security. The key features of Bluetooth technology are ubiquitousness, low power, and low cost. The Bluetooth Specification defines a uniform structure for a wide range of devices to connect and communicate with each other. A fundamental strength of Bluetooth wireless technology is the ability to simultaneously handle data and voice transmissions. which provides users with a variety of innovative solutions such as hands-free headsets for voice calls, printing and fax capabilities,andsynchronization for PCs and mobilephones, just to name a few. BLUETOOTH CORE SPECIFICATION Unlike other wireless standards, the Bluetooth Core Specification provides product developers both link layer and application layer definitions, which support data and voice applications.
  • 21. Bluetooth Technology 21 SPECTRUM Bluetooth technology operates in the unlicensed industrial, scientific and medical (ISM) band at 2.4 to 2.485 GHz, using a spread spectrum, frequency hopping, full-duplex signal at a nominal rate of 1600 hops/sec. The 2.4 GHz ISM band is available and unlicensed in most countries. INTERFERENCE Bluetooth technology's adaptive frequency hopping (AFH) capability was designed to reduce interference between wireless technologies sharing the 2.4 GHz spectrum. AFH works within the spectrum to take advantage of the available frequency. This is done by the technology detecting other devices in the spectrum and avoiding the frequencies they are using. This adaptive hopping among 79 frequencies at 1 MHz intervals gives a high degree of interference immunity and also allows for more efficient transmission within the spectrum. For users of Bluetooth technology this hopping provides greater performance even when other technologiesarebeing used along with Bluetooth technology. RANGE The range of Bluetooth technology is application specific. The Core Specification mandates a minimum range of 10 meters or 30 feet, but there is no set limit and manufacturers can tune their implementations to provide the range needed to support the use cases for theirsolutions. Range is application specific and although a minimum range is mandated by the Core Specification, there is not a limit and manufacturers can tune their implementation to support the use case theyare enabling. Range may vary depending on class ofradio used in an implementation:  Class 3 radios– have a range ofup to 1 meter or 3 feet  Class 2 radios – most commonly found in mobile devices – have a range of 10 meters or 33 feet  Class 1 radios – used primarily in industrial use cases – have a range of 100 meters or 300 feet.
  • 22. Bluetooth Technology 22 POWER The most commonly used radio is Class 2 and uses 2.5 mW of power. Bluetooth technology is designed to have very low power consumption. This is reinforced in the specificationbyallowing radios to be powered down when inactive. The Generic Alternate MAC/PHY in Version 3.0 HS enables the discovery of remote AMPs for high speed devices and turns on the radio only when needed for data transfer giving a poweroptimizationbenefit as well as aiding in thesecurity ofthe radios. Bluetooth low energy technology, optimized for devices requiring maximum battery life instead of a high data transfer rate, consumes between 1/2 and 1/100 the power of classic Bluetooth technology. Architecture Bluetooth definestwo types of networks: Piconet and scatternet. PICONET A Bluetooth network is called a piconet, or a small net. A piconet can have up to eight stations, one of which is called the primary; rest is called secondary. All the secondary stations synchronize their clocksand hopping sequence with the primary.
  • 23. Bluetooth Technology 23 Although a piconet can have a maximum of seven secondaries, an additional eighth secondary can be in parked state. A secondary in parked state is synchronized with the primary, but cannot take part in communication until it is moved from the parked state. Because only eight stations can be active in a piconet, activating a station from parked state means that an active station must go to the parked state. Piconets are established dynamically and automatically as Bluetooth enabled devices enter and leave radio proximity meaning that you can easily connect whenever and wherever it's convenient for you. SCATTERNET Piconet can be combined to form what is called a scatternet. A secondary station in one piconet can be the primary in another piconet. This station can receive messages from the primary in the first piconet (as a secondary) and, acting as a primary, deliver them to secondaries in thesecond piconet. A stationcan bemember of two piconets. Bluetooth Profiles To use Bluetooth wireless technology, a device must be able to interpret certain Bluetooth profiles. Bluetooth profiles are definitions of possible applications and specify general behaviors that Bluetooth enabled devices use to communicate with other Bluetooth devices. There is a wide range of Bluetooth profiles describing many different types of applications or use cases for devices. By following the guidance provided by the
  • 24. Bluetooth Technology 24 Bluetooth specification, developers can create applications to work with other Bluetooth devices. At a minimum, each Bluetooth profile contains information on the following topics:  Dependencies on otherprofiles, Suggested user interface formats  Specific parts of the Bluetooth protocol stack used by the profile. To perform its task, each profile uses particular options and parameters at each layer of the stack and this may include, if appropriate, an outline of the required service record GATT BASED GATT Based Description ANP Alert Notification Profile enables a client device to receive different types of alerts and event information, as well as information on the count of new alerts and unread items, which exist in theserver device. ANS Alert Notification Service exposes different types of alerts. BAS BatteryService exposes the stateof a batterywithina device. BLP BloodPressure Profile enables a device to connect and interact with a Blood Pressure Sensor device for use in consumer and professional health care applications. BLS BloodPressure Service exposes blood pressure and other data from a blood pressure monitor for use in consumer and professional healthcareapplications. CTS Current Time Service defines how the current time can be exposed using the Generic AttributeProfile (GATT). DIS Device Information Service exposes manufacturer information about a device. FMP Find Me Profile defines the behavior when a button is pressed on one device to cause an alerting signal on a peer device. HTP Health Thermometer Profile enables a Collector device to connect and interact with a Thermometer sensor for use in healthcare applications. HRP Heart Rate Profile enables a Collector device to connect and interact with a Heart Rate Sensor for use in fitness applications. HRS Heart Rate Service exposes heart rate and other data from a Heart Rate Sensor intended for fitness applications. HIDS HID Service exposes HID reports and other HID data intended for HID Hostsand HIDDevices.
  • 25. Bluetooth Technology 25 HOGP HID Over GATT Profile defines how a device with Bluetooth low energy wireless communications can support HID services over the Bluetooth low energy protocol stack using the Generic AttributeProfile. IAS ImmediateAlert Service exposes a control point to allow a peer device to cause thedevice to immediatelyalert. LLS Link Loss Service defines behavior when a link is lost between two devices. NDCS Next DST Change Service defines how the information about an upcoming DST change can be exposed using the Generic Attribute Profile (GATT). PASP Phone Alert Status Profile enables a PUID device to alert its user about the alert status of a phoneconnected to the PUIDdevice. PASS Phone Alert Status Service exposes the phonealert status when in a connection. PXP ProximityProfile enables proximitymonitoring between two devices. RTUS Reference Time UpdateService defines how a client can request an update from a reference time source from a time server using the Generic AttributeProfile (GATT). ScPP Scan Parameters Profile defines how a Scan Client device with Bluetooth low energy wireless communications can write its scanning behavior to a Scan Server, and how a Scan Server can request updates ofa Scan Client scanning behavior. ScPS Scan Parameters Service enables a GATT Client to store the LE scan parameters it is using on a GATT Server device so that the GATT Server can utilize the information to adjust behavior to optimize power consumption and/or reconnection latency. TIP Time Profile enables the device to get thedate, time, time zone, and DST information and control the functions related the time. TPS Tx Power Service exposes a device's current transmit power level when in a connection. BR/EDR PROFILES BR/EDR Profiles Description A2DP Advanced Audio DistributionProfile describes how stereo quality audio can be streamed from a media source to a sink. AVRCP Audio/Video Remote Control Profile is designed to provide a standard interface to control TVs, stereo audio equipment, or other A/V devices. This profile allows a single remote control (or other device)
  • 26. Bluetooth Technology 26 to control allA/V equipment to which a user has access. BIP Basic Imaging Profile defines how an imaging device can be remotely controlled, how an imaging device may print, and how an imaging device can transfer images to a storage device. BPP Basic Printing Profile allows devices to send text, e-mails, v-cards, images or otherinformation to printers based on print jobs. DI Device ID Profile provides additional information above and beyond the Bluetooth Class of Device and to incorporate the information into both the Service Discovery Profile (SDP) record and theEIR response. DUN Dial-Up Network Profile provides a standard to access the Internet and other dial-up services via Bluetooth technology. FTP File Transfer Profile defines how folders and files on a server device can be browsed by a client device. GAVDP Generic Audio/Video DistributionProfile provides the basis for A2DP and VDP, which are the basis of the systems designed for distributing video and audio streams using Bluetooth technology. GOEP Generic Object Profile is used to transfer an object from one device to another. HFP Hands-Free Profile HFP describes how a gateway device can be used to placeand receive calls for a hand-free device. HCRP Hard CopyCable Replacement Profile defines how driver-based printing is accomplished over a Bluetooth wireless link. HDP Health DeviceProfile enables Healthcareand Fitness device usage models. HSP Headset Profile describes how a Bluetooth enabled headset should communicate with a Bluetooth enabled device. HID Human Interface Device Profile defines the protocols, procedures and features to be used by Bluetooth keyboards, mice, pointing and gaming devices and remote monitoring devices. MAP Message Access Profile defines a set of features and procedures to exchange messages between devices. MPS Multi Profile defines a set of features and procedures between Multiple Profiles Single Device and Multiple Profiles MultipleDevices OPP Object Push Profile defines the roles of push server and push client. PBAP Phone BookAccess Profile defines the procedures and protocols to exchange Phone Bookobjectsbetween devices. PAN Personal Area Networking Profile describes how two or more Bluetooth enabled devices can form an ad-hoc network and how the same mechanism can be used to access a remote network through a network access point. SAP SIM Access Profile defines the protocols and procedures that shall be used to access a GSM SIM card, a UICC card or an R-UIM card
  • 27. Bluetooth Technology 27 via a Bluetooth link. SDAP Service Discovery ApplicationProfile describes how an application should use SDP to discover services on a remote device. SPP Service Port Profile defines how to set-up virtual serial ports and connect two Bluetooth enabled devices. SYNC Synchronization Profile used in conjunction with GOEP to enable synchronization of calendar and address information (personal information manager (PIM) items) between Bluetooth enabled devices. VDP Video Distribution Profile defines how a Bluetooth enabled device streams video over Bluetooth wireless technology. BR/EDR PROTOCOLS BR/EDR Protocols Description AVCTP Audio/Video Control Transport Protocol describes the transport mechanisms to exchange messages for controlling A/V devices. AVDTP Audio/Video Distribution Transport Protocol defines A/V stream negotiation, establishment and transmission procedures BNEP Bluetooth Network Encapsulation Protocol is used to transport common networking protocols over the Bluetooth mediasuch as IPv4 and IPv6. IrDA IrDA Interoperability offers the same features for applications as within the IrDA protocol hierarchy, enabling the applications to work over the Bluetooth protocol stack as well as the IrDA stack. OBEX Object Exchange a transfer protocol that defines data objects and a communication protocol two devices can use to exchange thoseobjects. RFCOMM RFCOMM with TS 07.10 emulates the serial cable line settings and status of an RS-232 serial port and is used for providing serial data transfer.
  • 28. Bluetooth Technology 28 BLUETOOTH LAYERS BLUETOOTH PROFILE – SPP (SERVICE PORT PROFILE) SPP defines how to set up virtual serial ports and connect two Bluetooth enabled devices. A scenario would be using two devices, such as PCs or laptops, as virtual serial ports and thenconnecting thetwo devices via Bluetooth technology. The SPP defines two roles, Device A and Device B.  Device A – This is the device that takes initiative to form a connection to anotherdevice (initiator).  Device B – This is the device that waits for another device to take initiative to connect (acceptor).
  • 29. Bluetooth Technology 29 The Baseband, LMP and L2CAP are the OSI layer 1 and 2 Bluetooth protocols. RFCOMM is the Bluetooth adaptation of GSM TS 07.10, providing a transport protocol for serial port emulation. SDP is the Bluetooth ServiceDiscovery Protocol. The port emulation layer shown in the figure to the left is the entity emulating the serial port, or providing an API to applications. The applications on both sides are typically legacy applications, able and wanting to communicate over a serial cable (which in this case is emulated). But legacy applications cannot know about Bluetooth procedures for setting up emulated serial cables, which is why they need help from some sort of Bluetooth aware helper application on both sides. (These issues are not explicitly addressed in this profile; the major concern here is for Bluetooth interoperability.) SDP (SERVICE DISCOVERY PROTOCOL) The SDP is used for location of services provided by or available through aBluetooth device and it facilitatesthefollowing:  The client’sabilityto search for theservices in thepiconet  Services to be discovered based on class of services (such as print service)  The capabilityto browseservices  To find out when a service becomes unavailable(device goes out of range)  The discoveryof new services (withinrange)  The detailsofservices such as classes and attributes  When a device wants to discover a service the client and the server exchange SDP messages. The attributes can be a service class ID list, a service ID, a protocol description, a provider name, an icon URL, a service name, and a service description. RFCOMM RFCOMM is a transport protocol to emulate serial communication (RS232 serial ports) over L2CAP. Two devices can communicate through RFCOMM over Bluetooth radio. RFCOMM emulates the nine connections of RS232 such as Request to Send, Transmit Data and Clear to Send. It supports two types of devices. Type 1 is communication end points
  • 30. Bluetooth Technology 30 (computers, printers) and type 2 devices are part of a communication segment such as a modem. L2CAP (LOGICAL LINK CONTROL AND ADAPTATION PROTOCOL) The Bluetooth logical link control and adaptation protocol (L2CAP) supports higher- level protocol multiplexing, packet segmentation and reassembly, and the conveying of qualityof service information. L2CAP permits higher level protocols and applications to transmit and receive upper layer datapackets(L2CAP Service Data Units, SDU) up to 64 kilobytes in length. L2CAP also permits per-channel flow control and retransmission via the Flow Control and Retransmission Modes. The L2CAP layer provides logical channels, named L2CAP channels, which map to L2CAP logicallinkssupported by an ACL logicaltransport L2CAP is based around the concept of 'channels'. Each one of the endpoints of an L2CAP channel is referred to by a channel identifier(CID). CHANNEL IDENTIFIERS A channel identifier (CID) is the local name representing a logical channel endpoint on the device. CID assignment is relative to a particular device and a device can assign CIDs independentlyfrom otherdevices (unless it needs to use any of the several reserved CIDs) OPERATION BETWEEN DEVICES The connection oriented data channels represent a connection between two devices, where a CID identifies each endpoint of the channel. The connectionless channels restrict data flow to a single direction. These channels are used to support a channel 'group' where the CID on the source represents one or more remote devices. There are also a number of CIDs reserved for special purposes. The signaling channel is one example of a reserved channel. This channel is used to create and establish connection-oriented data channels and to negotiate changes in the characteristics of connection oriented and connectionless channels.
  • 31. Bluetooth Technology 31 MODES OF OPERATION L2CAP may operate in one of three different modes as selected for each L2CAP channel by an upper layer. Themodes are:  Basic L2CAP Mode (equivalent to L2CAP specificationin Bluetooth v1.1)1  Flow Control Mode  Retransmission Mode DATA PACKET FORMAT L2CAP is packet-based but follows a communication model based on channels. A channel represents a data flow between L2CAP entities in remote devices. Channels may be connection-oriented or connectionless. SIGNALING PACKET FORMATS This section describes the signaling commands passed between two L2CAP entities on peer devices. All signaling commands are sent to the signaling channel with CID 0x0001. This signaling channel is available as soon as an ACL logical transport is set up and L2CAP traffic is enabled on the L2CAP logical link. Multiple commands may be sent in a single signaling command (C-frame). Commands take the form of Requests and Responses. All L2CAP implementations support the reception of C-frames with a payload length that does not exceed the signaling MTU. The minimum supported payload length for the C-frame (MTUsig) is 48 octets. L2CAP implementations should not use C-frames that exceed the MTUsig of the peer device. If they ever do, the peer device shall send a Command Reject containing the supported MTUsig. CONFIGURATION PARAMETER OPTIONS Options are a mechanism to extend the configuration parameters. Options are transmitted as information elements containing an option type, an option length, and one or more optiondatafields.
  • 32. Bluetooth Technology 32 HCI (HOST CONTROLLER INTERFACE) A Bluetooth device can have two parts: a module implementing the lower layers (LMP and under) and a software module (L2CAP and over) in the host. The Host Controller Interface handles communications between a separatehost and a Bluetooth module The HCI provides an interface so that the two modules can be from different vendors. The functions ofHCI are:  Setting up disconnecting, and configuring the links  Control of basebandfeatures such as timeouts  Retrieving status information  Local testing of thehardware module OVERVIEW OF HCICOMMANDS AND EVENTS Generic Events The generic events can occur due to multiple commands, or events that can occur at any time. Device Setup The device setup commands are used to place the Controller into a known state. Controller Flow Control The controller flow control commands and events are used to controldataflow from theHost to thecontroller. Controller Information The controller information commands allow the Host to discover localinformation about thedevice. Controller Configuration The controller configuration commands and events allow the globalconfigurationparameters to be configured. Device Discovery The device discovery commands and events allow a device to discover otherdevices in thesurrounding area. Connection Setup The connection setup commands and events allow a device to make a connection to another device. Remote Information The remote information commands and events allow information about a remote device's configuration to be discovered. Synchronous Connections The synchronous connection commands and events allow synchronous connections to becreated. Connection State The connection state commands and events allow the configurationof a link, especiallyfor low power operation. Piconet Structure The piconet structure commands and events allow the discovery and reconfiguration ofpiconet. Quality of Service The quality of service commands and events allow quality of service parameters to bespecified. Physical Links The physical link commands and events allow the configuration of
  • 33. Bluetooth Technology 33 a physicallink. Host Flow Control The Host flow control commands and events allow flow control to be used towards theHost. Link Information The link information commands and events allow information about a link to be read. Authentication and Encryption The authentication and encryption commands and events allow authenticationofa remote device and thenencryption of thelink. LINK MANAGER The Link Manager controls and configures links to other devices. It translates the commands into operationsat the Basebandlevel, managing the following operations.  Attaching slaves to piconets, and allocating theiractivemember addresses.  Breaking connections to detach Slaves from a piconet.  Configuring thelink including Master/Slave switches  Establishing ACL and SCO links.  Putting connections into Low Power modes: Hold,Sniff and Park.  Controlling test modes. BASEBAND LAYER The Baseband is the physical layer of the Bluetooth. It manages physical channels and links apart from other services like error correction, data whitening, hop selection and Bluetooth security. The Baseband layer lies on top of the Bluetooth radio layer in the bluetooth stack. The baseband protocol is implemented as a Link Controller, which works with the link manager for carrying out link level routines like link connection and power control. The baseband also manages asynchronous and synchronous links, handles packets and does paging and inquiry to access and inquire Bluetooth devices in the area. The baseband transceiver applies a time-division duplex (TDD) scheme. (Alternate transmit and receive). Therefore apart from different hopping frequency (frequency division), the time is also slotted.
  • 34. Bluetooth Technology 34 PACKET FORMAT Each packet consists of 3 entities, the access code (68/72 bits), the header (54 bits), and thepayload(0-2745bits). ACCESS CODE: Access codes are used for timing synchronization, offset compensation, paging and inquiry. There are three different typesof Access code: 1. Channel Access Code (CAC) 2. Device Access Code (DAC) 3. Inquiry Access Code (IAC) The channel access code identifies a unique piconet while the DAC is used for paging and its responses. IAC is used for inquiry purpose. HEADER: The header contains information for packet acknowledgement, packet numbering for out-of-order packet reordering, flow control, slave address and error check for header. PAYLOAD: The packet payload can contain either voice field, data field or both. It has a datafield; thepayloadwillalso contain a payloadheader.
  • 35. Future Scope 35 FUTURE SCOPE Getting a light to turn on and off may sound easy and probably even useless. But if we come to think of it, there’s much more to this project than just this much. The project can just be modified alittlebit to have real life implementationswhich would do wonders. Imagine having something similar in the Kitchen. A kitchen area with a LED strip/ lamp placed on top of the stove, preferably as long as the kitchen bench. What if this was controlled automatically by an Android phone? The phone could be made to automatically connect to the controller device for the LED strip/lamp, via Bluetooth, & turn on/off the lamp whenever a person enters/leaves. Not only that, the device could be made smarter by using an LED strip of light which changes colors/patterns on receiving phone calls/messages. This would really be an added advantage as the kitchen is generally a noisy place with the air extractor, microwave, blender and other appliances used frequently. Some kind of hands free notifications in such environments wouldsurely be appreciated.
  • 36. References 36 REFERENCES 1) Bluetooth SIG,SpecificationoftheBluetooth SystemVersion1.0B volume 1, 1999. http://www.bluetooth.com/developer/specification/core_10_b.pdf. 2) Guo, Y. Philips FM/IF systems for GMSK/GFSK receivers, Philips Semiconductors 1997 http://www.semiconductors.com/acrobat/applicationnotes/AN1997.pdf. Referred 5/10/2000 3) Markovic, V. Gaussian Minimum Shift Keying. Presentation given in course “Advanced Course in Digital Transmission” at Tampere University of Technology, 1999 http://www.cs.tut.fi/kurssit/83090/S13.ps. Referred 5/10/2000 4) Oraskari, Jyrki, Bluetooth 2000 http://www.hut.fi/~joraskur/bluetooth.html 5) Specification of the Bluetooth System Wireless connections madeeasy Core Version 1.1 February 22, 2001. http://www.ece.virgina.edu/~mmz4s/papers/ECE613project_bluetooth.pdf 6) Wireless Communications Information & Services “Bluetooth Specification; Bluetooth Technology overview”, http://www.thewirelessdirectory.com/BluetoothOverview/BluetoothSpecificatio n.htm. 7) http://www.developer.android.com 8) http://www.nxp.com/LPC-Overview/18xx-series-Specifications.html 9) http://www.lpcware.com/UserManual/LPC1830FET100-Board.htm 10) http://www.ngxtech.com/Support/Starter-LPCXpresso.html