Sunteți pe pagina 1din 57

Bluetooth Wireless Technology and PAN

Ilya Baraev Research Engineer Nokia Corp.

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Learn
Basics of Bluetooth Wireless technology About possibilities of Bluetooth and areas of application Practical knowledge about Bluetooth networking Developer opportunities for Bluetooth wireless technology

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Agenda
Overview Bluetooth networking details Profiles APIs and developers tools Q&A

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Agenda
Overview Bluetooth networking details Profiles APIs and developers tools Q&A

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Wireless Technology Overview


Appeared in 1994, Bluetooth SIG established in 1998 Bluetooth Wireless technology
Short-range wireless communication RF over the air (2.4 GHz) Limited range of connection (10-100m)

Fundamental characteristics
Open and royalty free specification Global usage free of charge Capability to handle voice and data Low power and suitable for portable devices

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth SIG (Special Interest Group)


Started with 5 member companies Almost 4000 member companies now Major task: develop the specification Additional tasks: IOP testing, marketing, legal, etc Different levels of contribution and access
Promoter Associate Adopter

More information at www.bluetooth.org

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Wireless Technology Core Specification


Core Specification
Low level spec Architectural overview Compliance requirements

Higher level specs and profiles are released independently from the core V1.0b and 1.1
Basic architecture, radio spec, basic protocols

V1.2 (November 2003)


Faster connection, coexistence with WLAN, improved QoS, improved voice quality

V2.0+EDR (November 2004)


Faster data transfer: up to 2.18 Mbit/s (user data rate)

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Use Cases
Cable replacement Phone headsets Audio streaming (stereo headsets) Portable keyboards In-car (Advanced hands free) Content exchange: pictures, videos, sound, applications Wireless printing Personal Information Management (PIM) data synchronization More than just a cable replacement: Personal Area Networking

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

PAN Use Cases 1/2


Multiplayer gaming
Low latency games, like action games Examples:
Nokia Pathway to Glory (6 multiplayer with Bluetooth) Agile Fighter Bluetooth Bluetooth Darts

Location-based services
Advertising in shopping malls, tourist guides, providing content at hot-spots Example:
Nokia Local Marketing Solution (www.nokia.com/localmarketing)

Social applications
Finding friends, exchanging flyers, personal page on a phone Examples:
Nokia Sensor (download at www.nokia.com/sensor) 6th sense (www.sixsense.com)

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

PAN Use Cases 2/2


Home
Phone as a remote control, sharing phone content, shopping list on a phone updated by a smart fridge

Enterprise
Access to email and calendar, synchronization Example:
Nokia Local Business Connectivity Solution (www.nokia.com/localconnectivity)

Identification
Storing e-tickets in a phone, payments, etc

Etc, etc, etc

10

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Agenda
Overview Bluetooth networking details Profiles APIs and developers tools Q&A

11

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Protocols
Application layer
WAP application
IrDA application

Telephony applications

Presentation layer Session layer Transport layer Network layer HCI Data link layer SDP

TCP IP

UDP

OBEX

AT com

PPP

TCS BIN Audio

RFCOMM

L2CAP LMP Baseband Bluetooth Radio

Physical layer

12

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Protocols Details


L2CAP = Logical Link and Control Adaptation Protocol
Packet-based, not fully reliable

RFCOMM
Stream-based, reliable

OBEX = Object Exchange protocol


Object-based

SDP = Service Discovery Protocol


Service discovery

BNEP = Bluetooth Network Emulation Protocol


Ethernet emulation Support for IPv4 and IPv6

More protocols are defined in the specification

13

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Connection Approach


Common Bluetooth connection approach

Inquiry

Service discovery

Connection

Communication

14

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Inquiry (Device Discovery)

Inquiry
A

D C

No inquiry scan = Non-discoverable

Inquiry scan = Discoverable


15 2005 Nokia Bluetooth.ppt / 2005-07-22 / IB

Service Discovery

Service discovery
A

D C

16

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Service Discovery Details


No central service repository
Each device maintains a database with own services

No central service ID authority


Services are defined by Bluetooth developers No need to register service Service identifier is UUID

Service Discovery Database Mandatory Attributes Service Records


ServiceRecordHandle ServiceClassIDList

Optional Attributes ......

ServiceRecordHandle

ServiceClassIDList

ServiceRecordHandle

ServiceClassIDList

A set of standard services are in the specification


Each profile specifies a standard service format

17

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Discovery Issues


Slow
10 sec for inquiry, up to 3 sec for service discovery per device

Problems in dense environments


10+ devices in vicinity

Rather complex source code


Callbacks, synchronization, threads, etc

Tips for improving discovery and connection usability


Mobile Bluetooth Networking with JSR-82 presentation Presentation #TS-3234 at JavaOne (USA, 2005) Download at java.sun.com/javaone/

18

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)

Page
A

D C

No page scan = Non-connectable

Page scan = Connectable


19 2005 Nokia Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)

Piconet - one master - 1 to 7 active slaves


master
A

slave

D C

slave

No page scan = Non-connectable

Page scan = Connectable


20 2005 Nokia Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)

Page scan = Connectable


master
A

slave

Page
slave
B D C

master slave

21

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)


Scatternet - more than one master - devices have mixed roles
slave

Page scan = Connectable


master
A

slave

D C

master slave

22

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)

Switch
master
A

slave

slave

D C

master slave

23

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Paging (Network Setup)

Piconet - one master - 1 to 7 active slaves


master
A

slave

D C

slave slave

24

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Connection Issues
In real life connecting is not easy
Bluetooth state have to be considered
Running inquiry Running service discovery Active connections Device role in connection Point-to-multipoint connections support

Ability to connect and to accept connections in various states is different


Partly possible to check using developers APIs

25

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Basic Rule
Form piconets, avoid scatternets
One master 1 to 7 active slaves

Why
Very often scatternets are not supported Slower data transfer rate

26

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Client-Server vs. Master-Slave


3 levels
Application logic level Developers API level Bluetooth networking level B A C D

BCD

Application Logic Developers Bluetooth


27 2005 Nokia Bluetooth.ppt / 2005-07-22 / IB

Server Initiator (Client) Master

Clients Acceptors (Servers) Slave

Two Ways to Form a Piconet


Server connects to clients / Application logic
A Recommended way B C D
Page

Clients connect to a server with m-s switch / Application logic


Switch

A
Page

28

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Master-Slave Switch
Not always supported
Sometimes it is possible to check support using APIs

Rely on master-slave switch only if you know what you are doing
Knowledge about the devices and its capabilities E.g. underlying platforms may have mechanism for master-slave roles configuration automatically (if master=false)

29

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Security
Authentication = proving that the other device is the one it claims to be
Ad hoc nature, no third party authorities Authentication depends on a shared secret (PIN code) First authentication involves PIN codes (aka pairing, bonding)

Encryption
Based on link key created during authentication Key maximum size is 128 bit

Additional: Authorization
Permission to access a service

30

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Agenda
Overview Bluetooth networking details Profiles APIs and developers tools Q&A

31

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles 1/2


Profile Standard use case
Application layer
WAP application
IrDA application

Telephony applications

Bluetooth profile defines


Protocol parameters Combines use of several protocols Common user experience

Presentation layer Session layer Transport layer Network layer HCI Data link layer SDP

TCP IP

UDP

OBEX

AT com

PPP

TCS BIN Audio

RFCOMM

L2CAP LMP Baseband Bluetooth Radio

Physical layer

Devices with the same profiles are able to:


Find each other Connect Communicate

Main goal: Interoperability


32 2005 Nokia Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles 2/2


Separate from the core specification
Defined in SIG Work Groups

Total 32 profiles (adopted and WIP) Profile areas


Serial port adaptation IrDA Interoperability (OBEX) Networking adaptation A/V connectivity Peripheral device connectivity Service discovery Cordless telephony Transparent bearer

33

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: Serial Port Adaptation


Serial Port Profile (SPP)
Enabler/transport, not application profile: SPP enables serial port (COM) connectivity Serial port (RS232 or similar) emulation Features:
Channel multiplexing Optional flow control
Internet Cellular Network

(Serial port emul. or other API) RFCOMM SDP LMP L2CAP

Baseband

Application Profiles
Dial-Up Networking Profile (DUNP) Fax Profile (FAX) Hands-Free Profile (HFP)
DT GW

34

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: IrDA Interoperability (OBEX)


Generic Object Exchange Profile (GOEP)
Enabler/transport, not application profile: SPP enables OBEX transport, thus IrDA interoperability Feature:
Connect/disconnect OBEX/object exchange sessions Push/pull objects OBEX sessions with authentication
push

(Application server or client) OBEX RFCOMM SDP LMP L2CAP

Baseband

Application Profiles
Object Push Profile (OPP) File Transfer Profile (FTP) Synchronization Profile (Sync) Basic Imaging Profile (BIP) Basic Printing Profile (BPP)
Sender Push client Printer

pull

Push server

35

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: Networking Adaptation


Personal Area Networking Profile (PAN)
Enabler/transport, not application profile PAN enables IP networking in a BT piconet
Supports both IPv4 & IPv6 IP auto configuration
Internet PAN U NAP

(Applications/ Higher layers) TCP UDP IP BNEP SDP LMP L2CAP Baseband

Compared to other Bluetooth profiles:


Compatible with other networks Allow any-to-any communication

Infrastructure Mode PAN U

PAN U

Ad-hoc mode or Infrastructure mode

Extended Service Discovery / UPnP Profile (ESDP)

Ad-hoc Mode PAN U

PAN U PAN U GN

36

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: Audio/Video Connectivity


Advanced Audio Distribution Profile (A2DP) / Generic A/V Distribution Profile (GAVDP)
(Near) CD quality stereo audio streaming in realtime to one device

(Application: source/sink) Audio codec AVDTP LMP SDP

L2CAP

Video Distribution Profile (VDP) / Generic A/V Distribution Profile (GAVDP)


(Small scale) video streaming in real-time Mixing with audio is possible

SNK

SNK

Baseband

SRC

A/V Remote Control Profile (AVRCP)


Simple remote control of A/V devices Designed to complement A2DP and VDP Typical IR remote commander functionality

SNK TG CT CT

TG

37

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: Peripheral Device Connectivity


Human Interface Device Profile (HID)
Connect HID devices with PC, PDA, phones: e.g. keyboard, mouse, joystick
Host HID

HID

Hardcopy Cable Replacement Profile (HCRP)


Legacy printing/scanning with available drivers and standard Printer Description Languages Replacement of parallel cable connection for legacy printing and scanning

Host

38

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Profiles: Other


Transparent bearer
Common ISDN Access Profile (CIP) SIM Access Profile (SAP)

Service discovery
Service Discovery Application Profile (SDAP)

Cordless telephony
Cordless Telephony Profile (CTP) Intercom Profile (IP)

Other profiles: work in progress

39

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Agenda
Overview Bluetooth networking details Profiles APIs and developers tools Q&A

40

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

C++ Bluetooth APIs


SDKs and APIs
Windows XP SP2 (or SP1) (msdn.microsoft.com/library/) BlueZ - Linux Bluetooth stack (www.bluez.org) Digianswer SDK (www.btsws.com) Cambridge Silicon Radio Development kit (www.csr.com) XTNDAccess Car SDK v1.0 Etc

Mobile
Symbian OS (www.symbian.com/developer/techlib/sdl.html) Nokia Series 60, Series 80 (forum.nokia.com -> Technologies -> Bluetooth) Palm Inc SDK and HDK Windows Mobile and Windows CE

41

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Java Bluetooth APIs


Java APIs for Bluetooth Wireless technology
Standard APIs Standardized by Java Community Process (www.jcp.org) Java Specification Request 82 (JSR-82) Defined for Java 2 Micro Edition (J2ME)

A number of non-standard APIs


Harald (www.control.lth.se/%7Ejohane/harald/) JBluez (www.sourceforge.net) BlueJ (www.sourceforge.net)

42

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Java APIs for Bluetooth (JSR-82)


Standard API Defined for Java 2 Micro Edition Supported by many mobile device models on the market Nokia: 17 device models are on the market and more are coming
6600, 6260, 6680, 6630, 6681, 7610, 3230, 6670, 6620, 9300, 9500, 8800, 6230, 6230i, 6255, 7710

A few implementations for desktop (J2SE)


List of some : www.javabluetooth.com

43

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Java APIs for Bluetooth (JSR-82) Details


javax.bluetooth
Discovery:
Inquiry, service discovery, service registration

Communication:
L2CAP, Serial Port Profile (RFCOMM)

Device management:
local and remote device

javax.obex
Generic Object Exchange Profile (GOEP) Optional Supported on upcoming devices
N90, N91, N70, 6280, 6265, 6265i, 6111, 6270

44

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Discovery Example 1/2


public void myInquiry() { // initialize BT stack da.startInquiry(DiscoveryAgent.GIAC, this); }

Inquiry

public void deviceDiscovered(RemoteDevice d, DeviceClass cod) { // save device in a list }

public void inquiryCompleted(int discType) { // optional: ask user to select devices out of list myServiceDiscovery(); }

45

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Discovery Example 2/2


public void myServiceDiscovery() { for(i=0; i < deviceList.length; i++) // wait until search is done } connect(); } public void serviceDiscovered(...) { // save service in a list } public void serviceSearchCompleted(...) { // indicate that the search is done }
Service discovery

da.searchServices(attrset, UUIDset, remd, this);

46

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Connection Example (Generic Connection Framework)


BCD
public void myConnect() { String acceptorURL = btspp://localhost: + uuid; ConnectionNotifier n = Connector.open(acceptorURL); Connection c = n.acceptAndOpen(); } Page

A B C D

A
public void myConnect() {

Connection c = Connector.open(btspp://0102030406:5); }

47

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Application Startup on Bluetooth Connection


Application startup on Bluetooth connection
MIDP 2.0 Push Registry and JSR-82 = Bluetooth Push

Not specified in JSR-82


Only briefly mentioned

Going to be clarified in JSR-248 Few phone support it


S60, starting from 2nd edition, Feature pack 2 6680, 6681, 6682, 6630

48

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Nokia Bluetooth Development Tools


Java SDKs
Nokia Prototype SDK 3.0 for the Java 2 Platform, Micro Edition Series 40 Developer Platform 2.0 SDK Series 60 Developer Platform SDK's for Symbian OS, for Java (various versions) Series 80 Developer Platform SDK's for Symbian OS, for Java

Symbian C++ SDKs


Series 60 Developer Platform SDK's for Symbian OS, for C++ (various versions) Series 80 Developer Platform 2.0 SDK for Symbian OS Series 60 Developer Platform SDK for Symbian OS, for C++, v0.9 (for 7650 and 3650) Nokia 7710 SDK for Symbian OS, For C++

Development suites
Nokia Developer's Suite 3.0 for J2ME Nokia Developer's Suite for Symbian OS

49

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Tools Integration with IDEs


Tools can be integrated with
Eclipse CodeWarrior Borland C++ Mobile Edition Microsoft Visual Studio Borland JBuilder NetBeans Sun Java Studio Mobility 6 IBM WebSphere Studio Device Developer Sun Wireless Toolkit etc

50

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Testing Support


Testing/debugging with Bluetooth hardware
Development on PC with Bluetooth hardware SDKs have access to Bluetooth hardware Starting from Series 60 Developer Platform SDK's for Symbian OS, 2nd edition, FP1 For C++ and Java

Nokia Connectivity Framework 1.2


Emulation of Bluetooth traffic Starting from Series 60 Developer Platform SDK's for Symbian OS, 2nd edition, FP2 For C++ and Java

Download and more information on forum.nokia.com

51

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Future of Bluetooth Wireless Technology


Future releases
Several future releases are planed More about features on www.bluetooth.org

Interesting collaboration
Bluetooth and Ultra Wide Band (UWB) UWB
Short-range about 10m Using wide bandwidth (3.1GHz 10GHz) High-speed data (up to 480Mbs)

52

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Summary
We learned..
Basics of Bluetooth Wireless technology Practical tips for Bluetooth networking About Bluetooth APIs and development tools

So start using Bluetooth and learn more by doing!

53

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

References 1/2
Bluetooth SIG website: www.bluetooth.org Yuan, Michael, Juntao; Sharp, KevinDeveloping Scalable Series 40 Applications, Nokia Mobile Developer Series, Addison-Wesley, 2005 Kumar, C Bala; Kline, Paul J.; Thompson, Timothy J.Bluetooth Application Programming with the Java APIs, Morgan Kaufman, 2004 Hopkins, Bruce; Antony, RanjithBluetooth for Java, Apress, 2003 Miller, Brent A.; Bisdikian, Chatschik Bluetooth Revealed, Prentice Hall, 2000 Baraev, Ilya Java APIs for Bluetooth Wireless Technology, Lappeenranta : Lappeenrannan teknillinen korkeakoulu, 2002 Baraev, Ilya; Mittal Nitin: - Mobile Bluetooth Networking With JSR 82: Practical recommendations and advanced practices, JavaOne: TS-3234(USA, 2005)

54

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

References 2/2
Java Community Process website (www.jcp.org) Java APIs for Bluetooth Wireless technology (JSR-82) www.jcp.org/en/jsr/detail?id=82 Bluetooth support on Symbian platforms: www.symbian.com/technology/product_descriptions.html Symbian Developers Library: www.symbian.com/developer/techlib/sdl.html Forum Nokia: forum.nokia.com

55

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Wireless Technology and PAN

Q&A

56

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

Bluetooth Wireless Technology and PAN


Ilya Baraev Research Engineer Nokia Corp.

57

2005 Nokia

Bluetooth.ppt / 2005-07-22 / IB

S-ar putea să vă placă și