Bruce Scharlau, University of Aberdeen, 2011 Bluetooth Considerations Mobile Computing Some slides from MobEduNet.

Slides:



Advertisements
Similar presentations
Bluetooth.
Advertisements

Mobile Computing and Commerce And Pervasive Computing
Bruce Scharlau, University of Aberdeen, 2010 Android UI, and Networking Mobile Computing Based on android-sdk_2.2 Unless otherwise stated, images are from.
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Chat Buddy JPMA F2004 Final Project Participants : Priyadarsini Seetharaman Safuriat O. Johnson Supervisor: Associate Prof. Dr. Jørgen Staunstrup.
Bluetooth. Wireless networking technology Limited broadcast range (< 10 meters) Example uses include Connecting headsets to phones, keyboard/mouse to.
1 Working with the Bluetooth radio Nilanjan Banerjee Mobile Systems Programming University of Arkansas Fayetteville, AR
University of Eastern Finland School of Computing P.O. Box 111 FIN Joensuu Tel fax Bluetooth Mikko.
Socket Programming ENTERPRISE JAVA. 2 Content  Sockets  Streams  Threads  Readings.
UNDERSTANDING JAVA APIS FOR MOBILE DEVICES v0.01.
CPET 260 Bluetooth. What is Bluetooth? Not IEEE (Wi-Fi) or HomeRF Originally designed to replace wires Short-range, lower-power wireless technology.
Bluetooth: Technology for Short-Range Wireless Apps Author:Pravin Bhagwat Presented by Chin-Yi Tsai IEEE INTERNET COMPUTING MAY.JUNE 2001.
1 Mini Course Programming Context-aware Mobile Phones Thomas Bodin IT University of Copenhagen.
A Comparison of Bluetooth and competing technologies
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Cosc 5/4730 Android Bluetooth. Bluetooth Basics First off Bluetooth is NOT – Infrared, which requires line-of-sight – a/b/g/n. It was designed as.
Bluetooth. Bluetooth is an open, wireless protocol for exchanging data between devices over a short distance. –managed by the Bluetooth Special Interest.
Bluetooth Introduction The Bluetooth Technology
XP New Perspectives on The Internet, Sixth Edition— Comprehensive Tutorial 6 1 Real-Time Communication on the Internet Exploring Wireless Networks Tutorial.
2011 Embedded Systems Software Training Center BluRapport SDK.
BLUETOOTH. Introduction Bluetooth technology discussed here aims at so-called ad- hoc piconets, which are local area networks with a very limited coverage.
Distributed systems – Part 2  Bluetooth – 2 nd set of slides Anila Mjeda.
Bluetooth Profile. Bluetooth profile A Bluetooth profile is a wireless interface specification for Bluetooth-based communication between devices. A Bluetooth.
INTRODUCTION Bluetooth technology is code name for Personal Area Network (PAN) technology that makes it extremely easy to connect a mobile, computing device.
By Santosh Sam Koshy. Agenda Need for Bluetooth Brief History of Bluetooth Introduction to Bluetooth Bluetooth System Specifications Commercial Bluetooth.
THE OSI MODEL AND THE TCP/IP PROTOCOL SUITE CS 1202 Lectur3 part2.
1.1 What is the Internet What is the Internet? The Internet is a shared media (coaxial cable, copper wire, fiber optics, and radio spectrum) communication.
Bluetooth Kirthika Parmeswaran Telcordia Technologies OOPSLA’2000.
Lecture 16Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 16 Bluetooth for MIDlets Rob Pooley
10/15/ Short-Range Radio Frequency Networking B. Ramamuthy.
An Investigation of Bluetooth Application Program Interface Layer Development Sam Knights Rhodes University Supervisors: Dr G. Foster and Prof P. Clayton.
Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph 1 Bluetooth Larry Rudolph Feb 16, 2006.
King Fahd University of Petroleum & Minerals Electrical Engineering Department EE400 PROJECT Personal Area Networks Instructed by Dr.AlGhadbanPresenters.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 - Bluetooth™ Wireless Technology Outline 23.1 Introduction 23.2 History of Bluetooth Wireless.
2.1 Chapter 2 Network Models Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
BLUETOOTH Created By: Ajay Bahoriya. Agenda Introduction to Bluetooth Bluetooth Basics Mode of operation Technology Security Advantages Integrating BT.
A tree line has a central line connecting together a series of star networks. The server is connected to a central line. Tree Network As the star, and.
Bluetooth Techniques Chapter 15. Overview of Bluetooth Initially developed by Swedish mobile phone maker in 1994 to let laptop computers make calls over.
발표자 : 현근수 Bluetooth. Overview wireless protocol short-range communications technology single digital wireless protocol connecting multiple devices mobile.
Team Topic Presentation Team 6 BLUETOOTH What is Bluetooth? Cable Replacement Automatic Connectivity Hidden Computing Few Examples: 1.Automatic Door.
Lectured By: Vivek Dimri Asst Professor CSE Deptt. SET.
Bluetooth In 1994, the L. M. Ericsson company became interested in connecting its mobile phones to other devices without cables. A SIG (Special Interest.
JPMA PROJECT PRESENTATION (ITU) 1 INTRODUCTION BLUETOOTH CHAT DESIGN JAVA ON MOBILE DEVICE Presenters Benjamin Boateng Abass Omer Venkateshwar Rao Namilakonda.
2.1 Chapter 2 Network Models Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Technology By :-. What Is Bluetooth? Designed to be used to connect both mobile devices and peripherals that currently require a wire Short range wireless.
Network media, protocols and networking standards, networking hardware.
Development of a Bluetooth based web camera module.
11-Jun-16 Seminar on BLUETOOTH.
Bluetooth Technology. History The name ‘Bluetooth’ was named after 10th century Viking king in Denmark Harald Bluetooth who united and controlled Denmark.
Bluetooth Technology -Prepared By Jasmin Patel -Guided By Jagruti Goswami.
ICT Unit 4: Network and the effects of using them
Respected Ma’am & Dear friends
Bluetooth Technology -Prepared By Jasmin Patel -Guided By Jagruti Goswami.
Created by :- prashant more prashant more. INTRODUCTION Bluetooth is wireless high speed data transfer technology over a short range ( meters).
Chapter 4 Computer Networks – Part 2
The OSI Model and the TCP/IP Protocol Suite
Three types of wireless technology
A Wireless LAN technologies IEEE
Wireless Universal Serial Bus
Wireless NETWORKS NET 434 Topic No 7 Bluetooth-IEEE802.15
The OSI Model and the TCP/IP Protocol Suite
Wireless NETWORKS NET 434 Topic No 7 Bluetooth-IEEE802.15
Bluetooth Profiles.
BLUETOOTH Personal Area Networking [ PAN ] over Bluetooth
Short-Range Radio Frequency Networking
Short-Range Radio Frequency Networking
Wireless networking Rytis Garbauskas.
The OSI Model and the TCP/IP Protocol Suite
Presentation transcript:

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth Considerations Mobile Computing Some slides from MobEduNet

Bruce Scharlau, University of Aberdeen, 2011 Electronic devices connect to one another in a variety of ways: –Data cable and a docking cradle connect a personal digital assistant (PDA) or a cellular phone to a computer –Radio waves connect a cordless phone to its base unit –Infrared beam connects a remote control to a television Better solution: Bluetooth

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth was supposed to replace cables Originally positioned as a replacement for cable, infrared, and other connection media But it offers a variety of other services, like synchronizing devices Works quietly, unconsciously, and automatically

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth is better than Infrared Infrared is reliable and cheep, but it has drawbacks: –Line-of-sight: sender must align with its receiver –One-to-one: a device can't send to multiple receivers at the same time Advantages: –Interference is uncommon –Message delivery is reliable

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth has different goals from wifi Both operate in the 2.4 GHz band b is designed to connect large devices with lots of power and speed Bluetooth is designed to connect small devices like PDAs, mobile phones, and peripherals

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth differs from wifi b: –Communicate at up to 11 Mbit/sec –Distances up to 100 meters Bluetooth: –1 Mbit/sec –Shorter range: 10 meters –Reduced power requirements

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth features Wireless and automatic Bluetooth is inexpensive (< $5 per unit) Handles both data and voice Signals are omni-directional and can pass through walls and briefcases Bluetooth uses frequency hopping

Bruce Scharlau, University of Aberdeen, 2011 Can do lots with Bluetooth on a mobile Mobile Another Mobile LaptopHeadset GPS

Bluetooth connects to sensors BT enabled sensors can be embedded anywhere for training, monitoring, etc Place sensor in shoes, strap to leg, etc for running Place sensor in car components for monitoring performance Place sensor in health equipment for ease of data transfer Bruce Scharlau, University of Aberdeen,

Bluetooth provides apps for cars More than music and hands free driving in cars Use bigger screen of car for more detail to find accommodation, food, etc Continuation of using apps in home for tasks Collect sensor data from car for use in other apps Bruce Scharlau, University of Aberdeen,

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth uses one of five profile types GAP = generic access profile, which enables other profiles and defines how to do other services PAN = personal area network, such as headset and phone, or laptop and phone SPP = serial port profile (over RFCOMM), such as printers use SP = synchronisation profile, such as synching contacts from phone to laptop SDAP = service discovery application profile, such as when you look for BT enabled devices (inquiry) and their offered services (discovery)

Bruce Scharlau, University of Aberdeen, 2011 Security is provided in three ways: Pseudo-random frequency hopping Authentication Encryption Generic Access Profile defines a security model

Bruce Scharlau, University of Aberdeen, 2011 Can also create a scatternet with Bluetooth One master and up to seven slaves = piconet A scatternet can have up to ten piconets

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth Protocol Stack Radio layer is the physical wireless connection Baseband layer is responsible for controlling and sending data packets over the radio link Link Manager Protocol (LMP) uses the links set up by the baseband to establish connections and manage piconets Host Controller Interface (HCI) is the dividing line between software and hardware Logical Link Control and Adaptation Protocol (L2CAP) receives application data and adapts it to the Bluetooth format

Bruce Scharlau, University of Aberdeen, 2011 The Bluetooth stack reaches down into the internals from your application Youll find API docs under docs/JSR082 in WTK

Bruce Scharlau, University of Aberdeen, 2011 The client and server roles are clearly defined with Bluetooth Device must initialised Need to find what is nearby Need to advertise, and then supply

Bruce Scharlau, University of Aberdeen, 2011 These are the common parts of Bluetooth enabled MIDlets Your device Other devices

Bruce Scharlau, University of Aberdeen, 2011 Dukes Auction and Bluetooth AuctionMIDlet AuctionMIDletServer AuctionMIDletService AuctionFinder Log DiscoveryListener Encapsulates URL Server functionality Display errors AuctionMIDlet.jad Permissions, PushRegistry List details in JAD file Used by all classes

Bruce Scharlau, University of Aberdeen, 2011 Set up the Push Registry to enable connections from other devices MIDlet-Version: MIDlet-Vendor: Midlet Suite Vendor MIDlet-Jar-URL: AuctionMidlet.jar MicroEdition-Configuration: CLDC-1.1 MIDlet-Permissions: javax.microedition.io.PushRegistry, javax.microedition.io.Connector.bluetooth.client,javax.microedition.io.Con nector.bluetooth.server MicroEdition-Profile: MIDP-1.0 MIDlet-1: AuctionMIDlet,,com.auction.j2me.AuctionMIDlet MIDlet-Name: AuctionMidlet Midlet Suite MIDlet-Push-1: btspp://localhost:F0E0D0C0B0A ;name=com.auctio n.j2me.AuctionMIDlet, * Same UUID detailed in AuctionMIDletService class UUID = 128 bit hexadecimal as a String

Bruce Scharlau, University of Aberdeen, 2011 The push registry needs specific details MIDlet-Push-1: btspp://localhost:F0E0D0C0B0A ;name=com.auction.j2 me.AuctionMIDlet, * MIDlet-Push- :,,

Bruce Scharlau, University of Aberdeen, 2011 Set up BT to enable specific types of connections based on Generic connection framework A server RFCOMM URL: btspp://localhost:2D FB47C28D9F10B8E C891363;authenticate=false; encrypt=false;name=MyBtService A client RFCOMM URL: btspp:// AF:1;master=false; encrypt=false;authenticate=false

Bruce Scharlau, University of Aberdeen, 2011 Initialise the device first LocalDevice bt = LocalDevice.getLocalDevice(); DiscoveryAgent da = bt.getDiscoveryAgent(); boolean success = da.startInquiry(DiscoveryAgent.GIAC, this); mSearching = true; Make us discoverable, and look for others Code from AuctionFinder

Bruce Scharlau, University of Aberdeen, 2011 There are two kinds of discoverable settings that you can use GIAC = indefinately discoverable LIAC = limited (usually a minute) discoverability

Bruce Scharlau, University of Aberdeen, 2011 Second, discover and then consume services Look for nearby devices Discover what services they offer

Bruce Scharlau, University of Aberdeen, 2011 Add new devices to the Service Discovery Database (SDDB) RemoteDevice rd = servRecord[i].getHostDevice(); String name = rd.getFriendlyName(false); String address = rd.getBluetoothAddress(); String url = servRecord[i].getConnectionURL(ServiceRecord.NOAUTH ENTICATE_NOENCRYPT, false); AuctionMIDletService ams = new AuctionMIDletService(name, address, url); mNewServices.addElement(ams); Code from AuctionFinder

Bruce Scharlau, University of Aberdeen, 2011 Check for specific services on the device public void deviceDiscovered(RemoteDevice rd, DeviceClass dc) { try { LocalDevice bt = LocalDevice.getLocalDevice(); DiscoveryAgent da = bt.getDiscoveryAgent(); UUID[] uuidSet = {AuctionMIDletService.AUCTIONMIDLET_UUID}; mPendingServiceSearches++; da.searchServices(null, uuidSet, rd, this); } catch … Code from AuctionFinder

Bruce Scharlau, University of Aberdeen, 2011 Consume desired service (send a message) private void runURL(String url) throws IOException { StreamConnection sc = null; DataOutputStream dataOut = null; try { sc = (StreamConnection) Connector.open(url); dataOut = new DataOutputStream(sc.openDataOutputStream()); LocalDevice bt = LocalDevice.getLocalDevice(); String from = bt.getFriendlyName() + ":" + bt.getBluetoothAddress(); dataOut.writeUTF(from); dataOut.writeUTF(mMessageField.getString()); } finally { … // close connections Code from AuctionMIDlet

Bruce Scharlau, University of Aberdeen, 2011 Find a device, and send a message Sees B A A B B Sees A Sends message to B Receives message from A

Bruce Scharlau, University of Aberdeen, 2011 Receive and show the message public void messageReceived(String from, String message) { int layout = Item.LAYOUT_NEWLINE_AFTER; StringItem si; Form messageForm = new Form("Message"); si = new StringItem("From:", from); si.setLayout(layout); messageForm.append(si); si = new StringItem("Message:", message); si.setLayout(layout); messageForm.append(si); messageForm.addCommand(mBackCommand); messageForm.setCommandListener(this); display.setCurrent(messageForm); } Code from AuctionMIDlet

Bruce Scharlau, University of Aberdeen, 2011 Third, server advertises, waits for (and serves) clients, stops service UUID uuid = AuctionMIDletService.AUCTIONMIDLET_UUID; String cs = "btspp://localhost:" + uuid.toString() + ";name=AuctionMidlet"; mNotifier = (StreamConnectionNotifier)Connector.open(cs); while (mTrucking) { // Get the next incoming connection. StreamConnection sc = mNotifier.acceptAndOpen(); DataInputStream dataIn = new DataInputStream( sc.openInputStream()); String from = dataIn.readUTF(); String message = dataIn.readUTF(); mAuctionMIDlet.messageReceived(from, message); dataIn.close(); sc.close(); } catch …. Display the message Code from AuctionMIDletServer

Bruce Scharlau, University of Aberdeen, 2011 Bluetooth should be done with separate classes so that you can reuse components in your application If everything is in one class, then you need to make the methods reusable

Bluetooth on android focuses on four tasks: 1.Set up Bluetooth with adapter class 2.Find available, or paired devices 3.Connect to specified device 4.Transfer data between the connected devices Bruce Scharlau, University of Aberdeen, 2011

Android uses five classes for BT BluetoothAdapter - Represents the local Bluetooth adapter and is the entry-point for all Bluetooth interaction. BluetoothDevice - Represents a remote Bluetooth device. BluetoothSocket - Represents the interface for a Bluetooth socket as a connection point to exchange data with another Bluetooth device via InputStream and OutputStream. BluetoothServerSocket - Represents an open server socket that listens for incoming requests andwill return a connected BluetoothSocket when the connection is accepted. BluetoothClass - Describes the general characteristics and capabilities of a Bluetooth device as a read-only set of properties. Bruce Scharlau, University of Aberdeen, 2011

Also set permissions in manifest Need to set BLUETOOTH permission for any BT activity Need to set BLUETOOTH_ADMIN for discovery and manipulate BT settings Need to also set BLUETOOTH when using admin. Bruce Scharlau, University of Aberdeen, 2011

See dev guide and example reless/bluetooth.htmlhttp://developer.android.com/guide/topics/wi reless/bluetooth.html has all details and link to chat example Bruce Scharlau, University of Aberdeen, 2011