Table Of ContentBLUETOOTH(cid:2) APPLICATION PROGRAMMING
WITH THE JAVATM APIs ESSENTIALSEDITION
The Morgan Kaufmann Series in Networking
SeriesEditor,DavidClark,M.I.T.
BluetoothApplicationProgrammingwiththeJavaAPIs,EssentialsEdition
TimothyJ.Thompson,PaulJ.Kline,andCBalaKumar
InternetMultimediaCommunicationsUsingSIP
RogelioMartinezPerea
InformationAssurance:DependabilityandSecurityinNetworkedSystems
YiQian,JamesJoshi,DavidTipper,andPrashantKrishnamurthy
NetworkSimulationExperimentsManual,2e
EmadAboelela
NetworkAnalysis,Architecture,andDesign,3e
JamesD.McCabe
WirelessCommunications&Networking:AnIntroduction
VijayK.Garg
EthernetNetworkingfortheSmallOfficeandProfessionalHomeOffice
JanL.Harrington
IPv6AdvancedProtocolsImplementation
QingLi,TatuyaJinmei,andKeiichiShima
ComputerNetworks:ASystemsApproach,4e
LarryL.PetersonandBruceS.Davie
NetworkRouting:Algorithms,Protocols,andArchitectures
DeepankarMedhiandKarthikeyanRamaswami
DeployingIPandMPLSQoSforMultiserviceNetworks:TheoryandPractice
JohnEvansandClarenceFilsfils
TrafficEngineeringandQoSOptimizationofIntegratedVoice&DataNetworks
GeraldR.Ash
IPv6CoreProtocolsImplementation
QingLi,TatuyaJinmei,andKeiichiShima
SmartPhoneandNext-GenerationMobileComputing
PeiZhengandLionelNi
GMPLS:ArchitectureandApplications
AdrianFarrelandIgorBryskin
NetworkSecurity:APracticalApproach
JanL.Harrington
ContentNetworking:Architecture,Protocols,andPractice
MarkusHofmannandLelandR.Beaumont
NetworkAlgorithmics:AnInterdisciplinaryApproachtoDesigningFastNetworkedDevices
GeorgeVarghese
NetworkRecovery:ProtectionandRestorationofOptical,SONET-SDH,IP,andMPLS
JeanPhilippeVasseur,MarioPickavet,andPietDemeester
Routing,Flow,andCapacityDesigninCommunicationandComputerNetworks
MichałPio´roandDeepankarMedhi
WirelessSensorNetworks:AnInformationProcessingApproach
FengZhaoandLeonidasGuibas
CommunicationNetworking:AnAnalyticalApproach
AnuragKumar,D.Manjunath,andJoyKuri
TheInternetandItsProtocols:AComparativeApproach
AdrianFarrel
ModernCableTelevisionTechnology: Video,Voice,andDataCommunications,2e
WalterCiciora,JamesFarmer,DavidLarge,andMichaelAdams
BluetoothApplicationProgrammingwiththeJavaAPIs
CBalaKumar,PaulJ.Kline,andTimothyJ.Thompson
Policy-BasedNetworkManagement:SolutionsfortheNextGeneration
JohnStrassner
MPLSNetworkManagement:MIBs,Tools,andTechniques
ThomasD.Nadeau
DevelopingIP-BasedServices:SolutionsforServiceProvidersandVendors
MoniqueMorrowandKateelVijayananda
TelecommunicationsLawintheInternetAge
SharonK.Black
OpticalNetworks: APracticalPerspective,2e
RajivRamaswamiandKumarN.Sivarajan
InternetQoS:ArchitecturesandMechanisms
ZhengWang
TCP/IPSocketsinJava:PracticalGuideforProgrammers
MichaelJ.DonahooandKennethL.Calvert
TCP/IPSocketsinC:PracticalGuideforProgrammers
KennethL.CalvertandMichaelJ.Donahoo
MulticastCommunication:Protocols,Programming,andApplications
RalphWittmannandMartinaZitterbart
MPLS:TechnologyandApplications
BruceDavieandYakovRekhter
High-PerformanceCommunicationNetworks,2e
JeanWalrandandPravinVaraiya
InternetworkingMultimedia
JonCrowcroft,MarkHandley,andIanWakeman
UnderstandingNetworkedApplications:AFirstCourse
DavidG.Messerschmitt
IntegratedManagementofNetworkedSystems:Concepts,Architectures,andTheirOperationalApplication
Heinz-GerdHegering,SebastianAbeck,andBernhardNeumair
VirtualPrivateNetworks:MakingtheRightConnection
DennisFowler
NetworkedApplications:AGuidetotheNewComputingInfrastructure
DavidG.Messerschmitt
WideAreaNetworkDesign:ConceptsandToolsforOptimization
RobertS.Cahn
Forfurtherinformationonthesebooksandforalistofforthcomingtitles,
pleasevisitourWebsiteathttp://www.mkp.com.
(cid:84)(cid:104)(cid:105)(cid:115)(cid:32)(cid:112)(cid:97)(cid:103)(cid:101)(cid:32)(cid:105)(cid:110)(cid:116)(cid:101)(cid:110)(cid:116)(cid:105)(cid:111)(cid:110)(cid:97)(cid:108)(cid:108)(cid:121)(cid:32)(cid:108)(cid:101)(cid:102)(cid:116)(cid:32)(cid:98)(cid:108)(cid:97)(cid:110)(cid:107)
BLUETOOTH(cid:2) APPLICATION
PROGRAMMING
WITH THE JAVATM APIs
ESSENTIALSEDITION
TIMOTHY J.THOMPSON
PAUL J.KLINE
C BALA KUMAR
PublishingDirector: JoanneTracy
Publisher: DeniseE.M.Penrose
AcquisitionsEditor: RickAdams
PublishingServicesManager: GeorgeMorrison
ProductionEditor: LianneHong
AssistantEditor: GregoryChalson
DesignDirection: JoanneBlank
CoverDesign: DickHannus
CoverImages: iStockphoto
Composition: IntegraSoftwareServices
Copyeditor: MelissaRevell
Proofreader: PhyllisCoyneetal.ProofreadingService
Indexer: KeithShostak
InteriorPrinter: SheridanBooks,Inc.
CoverPrinter: PhoenixColorCorporation
MorganKaufmannPublishersisanimprintofElsevier.
30CorporateDrive,Suite400,Burlington,MA01803,USA
Thisbookisprintedonacid-freepaper.
2008byElsevierInc.Allrightsreserved.
Designationsusedbycompaniestodistinguishtheirproductsareoftenclaimedastrademarksorregisteredtrademarks.
InallinstancesinwhichMorganKaufmannPublishersisawareofaclaim,theproductnamesappearininitialcapitalor
allcapitalletters.Readers,however,shouldcontacttheappropriatecompaniesformorecompleteinformation
regardingtrademarksandregistration.
Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyany
means—electronic,mechanical,photocopying,scanning,orotherwise—withoutpriorwrittenpermissionofthe
publisher.
PermissionsmaybesoughtdirectlyfromElsevier’sScience&TechnologyRightsDepartmentinOxford,UK:
phone:(+44)1865843830,fax:(+44)1865853333,E-mail:permissions@elsevier.com.Youmayalsocompleteyour
requestonlineviatheElsevierhomepage(http://elsevier.com),byselecting‘‘Support&Contact’’then
‘‘CopyrightandPermission’’andthen‘‘ObtainingPermissions.’’
LibraryofCongressCataloging-in-PublicationData
Thompson,TimothyJ.
BluetoothapplicationprogrammingwiththeJavaAPIs/TimJ.Thompson,PaulJ.Kline,andCBala
Kumar.–Essentialsed.
p.cm.– (MorganKaufmannseriesinnetworking)
C.BalaKumar’snameappearedfirstont.p.ofearliered.
Includesbibliographicalreferencesandindex.
ISBN-13:978-0-12-374342-8(pbk.:alk.paper) 1. Bluetoothtechnology.2. Java(Computerprogramlanguage)
3. Applicationprograminterfaces(Computersoftware)4. Wirelesscommunicationsystems. I.Kline,PaulJ.II.Kumar,
C.Bala.III.Kumar,C.Bala.BluetoothapplicationprogrammingwiththeJavaAPIs.IV.Title.
TK5103.3.K862008
004.6’2–dc22
2007043858
ISBN:978-0-12-374342-8
ForinformationonallMorganKaufmannpublications,
visitourWebsiteatwww.mkp.comorwww.books.elsevier.com
PrintedintheUnitedStatesofAmerica
08 09 10 11 12 5 4 3 2 1
Working together to grow
libraries in developing countries
www.elsevier.com | www.bookaid.org | www.sabre.org
To my wife, Karmen, and son, Zane
—Tim
To my daughter, Rose, and her family, Terry, Morgan, and
Andrew
—Paul
To my wife, Sundari, and sons, Sailesh and Shiva
—Bala
(cid:84)(cid:104)(cid:105)(cid:115)(cid:32)(cid:112)(cid:97)(cid:103)(cid:101)(cid:32)(cid:105)(cid:110)(cid:116)(cid:101)(cid:110)(cid:116)(cid:105)(cid:111)(cid:110)(cid:97)(cid:108)(cid:108)(cid:121)(cid:32)(cid:108)(cid:101)(cid:102)(cid:116)(cid:32)(cid:98)(cid:108)(cid:97)(cid:110)(cid:107)
Contents
PREFACE............................................................................ xiii
ABOUT THE AUTHORS ................................................................. xvi
ACKNOWLEDGMENTS.................................................................. xvii
CHAPTER1 Introduction................................................... 1
1.1 Wireless Connectivity........................................ 1
1.2 What IsBluetooth Wireless Technology?.................... 3
1.2.1 History of Bluetooth WirelessTechnology................ 4
1.2.2 Bluetooth Vision......................................... 5
1.2.3 Bluetooth Specification.................................. 7
1.3 Overview ofBluetooth Stack Architecture................... 7
1.3.1 Bluetooth Protocols ..................................... 9
1.3.2 Bluetooth Profiles ....................................... 11
1.3.3 Bluetooth Qualification.................................. 13
1.4 What IsJAVA ME?............................................ 14
1.4.1 Configurations.......................................... 15
1.4.2 Profiles.................................................. 17
1.4.3 Optional Packages ...................................... 18
1.5 Why JAVA Technology for Bluetooth Devices? .............. 18
1.5.1 JavaCommunityProcessSM(JCP)and JSR-82............. 19
1.5.2 What about JavaSE? .................................... 20
1.6 Summary..................................................... 21
CHAPTER2 An Overviewof JABWT........................................ 23
2.1 Goals......................................................... 23
2.1.1 Target Devices.......................................... 24
2.1.2 Keeping up with theBluetooth Profiles .................. 24
2.1.3 JABWT Use Cases........................................ 26
ix
Description:The book presents a detailed and insightful look into programming Bluetooth applications in JavaME, with lots of programming examples. I teach a course on mobile and pervasive computing, and this book has been certainly helpful. I have been waiting for such a book - each layer of the protocol stack