JSR82: Past, Present and Future

4,620 views

Published on

Talk given at the Java Mobile and Wireless Developer Days conference, Jan 2008

Published in: Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,620
On SlideShare
0
From Embeds
0
Number of Embeds
150
Actions
Shares
0
Downloads
0
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

JSR82: Past, Present and Future

  1. 1. JSR82 Past, Present and Future for Java/Bluetooth APIs Sean O Sullivan, CTO, Rococo Soft ware sos@rococosoft.com
  2. 2. Over view Introduction Bluetooth background JSR82 - Java Bluetooth APIs Bluetooth Evolution Next steps for JSR82
  3. 3. Rococo Soft ware company based in Dublin, Ireland Specialists in Java/Bluetooth since 2000 Sell tools and handset/embedded soft ware 100M+ units shipped
  4. 4. Bluetooth Short Range Wireless 1m - 100m “cable replacement” Ad-hoc Piconets
  5. 5. Bluetooth Design Goals Short range Low Power Ad Hoc Secure Robust Easy to Use
  6. 6. Bluetooth by numbers 1998 64% 7 - 10,000 6-8% 2.0 + EDR 45% 1.8Bn $5 now <$2, even $1 1 - 100mW 1 - 3 Mb/s
  7. 7. Where does it go (07)? 70M 500M 80M
  8. 8. Bluetooth Architecture UDP TCP Audio IP Bluetooth Stack PPP OBEX Service Discovery RFCOMM Protocol Logical Link Control and Adaptation Protocol Host Controller Interface Host Controller Interface Firmware Bluetooth Host Link manager Protocol Controller Baseband and Baseband Link Controller Firmware Bluetooth Radio
  9. 9. Bluetooth Profiles Generic Access Profile SDAP TCS Bin based profiles Intercom Profile Cordless Phone Serial Port Profile Generic Object Exchange Dial Up Networking Profile File Transfer Fax Profile Object Push Headset Profile Synchronisation LAN Access Profile
  10. 10. Bluetooth and APIs Bluetooth’s dirty little secret Well ok, it’s not really a secret.....and it’s not that dirty No Common API for Bluetooth Stacks defined as part of the Bluetooth standard Why not? Stacks were a pretty competitive area in the early days of Bluetooth Can create development issues
  11. 11. JSR82 aka JABWT Provide Java APIs for Profiles supported : common Bluetooth GAP, SDAP, SPP, GOEP, functionality L2CAP, RFCOMM, SDP, OBEX Started Oct ‘00, completed March ’02 Generic Access Profile SDAP TCS Bin based profiles Chaired by Motorola; Intercom Profile Cordless Phone other members Serial Port Profile Generic Object Exchange Dial Up Networking Profile included Rococo, Fax Profile File Transfer Nokia, Ericsson, Headset Profile Object Push Mitsubishi, Extended Synchronisation LAN Access Profile Systems and more
  12. 12. JSR82 - Timeline JSR82 Expert Group formed JSR82 1.0 Review JSR82 1.1 JSR82 Main standards work Maintenance review 2000 2001 2002 2003 2004 2005 2006 2007 Impronto DevKit 1.1 1.2 1.3 1.4 1.0 Rococo Impronto 1.1 1.2 1.3 Simulator 1.0 Impronto TLK
  13. 13. JSR82 Overview Application JSR82 APIs OBEX Service Discovery RFCOMM Protocol Logical Link Control and Adaptation Protocol Host Controller Interface Host Controller Interface Firmware Link manager Protocol Baseband Link Controller Bluetooth Radio
  14. 14. JSR82 Overview Depends only on CLDC Two TCKs Requires GCF Data-Centric (not voice) Two packages (javax.obex and Asynchronous javax.bluetooth) application start (JSR118) - initially Javax.obex not supported javax.microedition.io javax.bluetooth
  15. 15. JSR82 Overview Manage and control Device Management connections Device Discovery <<uses>> Ser vice Discovery discovery Ser vice Registration <<uses>> Connection Establishing connections Using connections
  16. 16. Clients and Ser vers Clients typically... Discover Devices Use Ser vice Discovery Protocol to query remote SDDB for ser vices Connect and use required service(s) Disconnect when finished Servers typically... Create a Service Record Add Ser vice Record to Service Record Database Wait for connections Accept and process incoming connections Update Ser vice Record when/if changes to the ser vices De-register or disable Service Record when it’s no longer needed May be both client and server....
  17. 17. Discovery : LocalDevice javax.bluetooth::LocalDevice discoveryAgent:DiscoveryAgent localDevice:LocalDevice LocalDevice(...) getBluetoothAddress(...) getDeviceClass(...) getDiscoverable(...) getDiscoveryAgent(...) getFriendlyName(...) getLocalDevice(...) getProperty(...) /** getRecord(...) setDiscoverable(...) * Initialize updateRecord(...) */ public void btInit() throws BluetoothStateException { localDevice = null; discoveryAgent = null; // Retrieve the local device to get to the Bluetooth Manager localDevice = LocalDevice.getLocalDevice(); // Clients retrieve the discovery agent discoveryAgent = localDevice.getDiscoveryAgent(); } Source: C. Enrique Ortiz - Using the Java APIs for Bluetooth, Part 2: Putting the Core APIs to Work
  18. 18. Discovery DiscoveryAgent class used for both Device and Ser vice Discovery startInquiry() - non-blocking specify a listener for the callbacks retrieveDevices() - blocking returns information about pre-known devices (devices previously discovered)
  19. 19. Discovery javax.bluetooth::DiscoveryListener INQUIRY_COMPLETED: int INQUIRY_ERROR: int INQUIRY_TERMINATED: int SERVICES_SEARCH_COMPLETED: int SERVICES_SEARCH_DEVICE_NOT_REACHABLE: int SERVICES_SEARCH_ERROR: int SERVICES_SEARCH_NO_RECORDS: int SERVICES_SEARCH_TERMINATED: int deviceDiscovered(...) inquiryCompleted(...) servicesDiscovered(...) servicesSearchCompleted(...) implements Client 1 1 Initiate and uses javax.bluetooth::DiscoveryAgent Cancel device discovery CACHEC: int GIAC:int LIAC:int NOT_DISCOVERABLE:int PREKNOWN:int DiscoveryAgent(...) cancelInquiry(...) Callbacks on cancelServiceSearch(...) DiscoveryListener retrieveDevices(...) methods during searchServices(...) inquiry selectServices(...) startInquiry(...)
  20. 20. Service Discovery Search for services of a particular class Retrieve service attributes of a service Get services and their attributes in one go Stop a ser vice search in progress
  21. 21. Connections Based on GCF; Represented by L2CAPConnection and StreamConnection types Bluetooth Connections created using GCF connection factory: javax.microedition.io.Connector.open() parameter = connectionURL btl2cap://hostname [PSM | UUID]; parameters btspp://hostname [CN | UUID]; parameters hostname either localhost (server) or BTAddr
  22. 22. Connections ... // Bluetooth Service name private static final String myServiceName = quot;MyBtServicequot;; // Bluetooth Service UUID of interest private static final String myServiceUUID = quot;2d26618601fb47c28d9f10b8ec891363quot;; private UUID MYSERVICEUUID_UUID = new UUID(myServiceUUID, false); ... // Define the server connection URL String connURL = quot;btspp://localhost:quot;+MYSERVICEUUID_UUID.toString() +quot;;quot;+name=quot;+myServiceName; ... // Create a server connection (a notifier) StreamConnectionNotifier scn = (StreamConnectionNotifier) Connector.open(connURL); ... // Accept a new client connection StreamConnection sc = scn.acceptAndOpen(); ... Source: C. Enrique Ortiz - Using the Java APIs for Bluetooth, Part 2: Putting the Core APIs to Work
  23. 23. Connections ... // Given a service of interest, get its service record ServiceRecord sr = (ServiceRecord)discoveredServices.elementAt(i); // Then get the service's connection URL String connURL = sr.getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false); // Open connection StreamConnection sc = (StreamConnection) Connector.open(connURL); ... Source: C. Enrique Ortiz - Using the Java APIs for Bluetooth, Part 2: Putting the Core APIs to Work
  24. 24. Wait for a connection ... // Wait for client connection StreamConnection conn = streamConnectionNotifier.acceptAndOpen(); // New client connection accepted; get a handle on it RemoteDevice rd = RemoteDevice.getRemoteDevice(conn); System.out.println(quot;New client connection... quot; + rd.getFriendlyName(false)); // Read input message, in this example a String DataInputStream dataIn = conn.openDataInputStream(); String s = dataIn.readUTF(); // Pass received message to incoming message listener ... Source: C. Enrique Ortiz - Using the Java APIs for Bluetooth, Part 2: Putting the Core APIs to Work
  25. 25. Push Registry Net work and timer-initiated midlet activation Inbound net work connection or timer- based alarm can wake a midlet midlet can register with Push Registry, statically or dynamically Example Use case: Health Care Monitor
  26. 26. Power Management If an API is invoked that requires Bluetooth to be powered on, and enabled, then JSR82 MUST Notify user SHOULD Prompt user to activate If user approves, Bluetooth MUST be activated (Powered on, Enabled) Localdevice.isPowerOn() NOT RADIO / BT ENABLED ENABLED RADIO ON Proceed Notify RADIO OFF Notify Notify
  27. 27. BCC Bluetooth Control Center Central authority for certain Bluetooth settings MUST provide MAY provide Device wide security settings Setting Device Name Known devices Baseband timeouts Trusted devices Reset device Pairing mechanism Determining how connectable and discoverable are set Authorization of connection requests Enumerating ser vices on device
  28. 28. JSR82 Implementations Phones Dev Kits OEM Nokia Nokia Symbian Sun Motorola Atinav Samsung Avetana avelink Sony Ericsson BlueCove jsrsoft Sharp jsrsoft Rococo Siemens Harald BenQ javabluetooth.org QTek Rococo HTC
  29. 29. Rococo’s Approach Support JSR82 from inception Offer tools to developers Simulator DevKit Offer implementation(s) to Equipment Manufacturers Initial interest: handset manufacturers
  30. 30. JSR82 Bluetooth Simulator
  31. 31. Current status of the JSR82 standard Now at JSR82 1.1 1.1 brought Tidy ups PushRegistry
  32. 32. Evolution of Bluetooth Bluetooth SIG has been “busy” :-) Embrace and Extend philosophy on short range wireless standards Some recent developments WiBree and ULP NFC UWB BECI
  33. 33. WiBree and ULP Nokia started working on low power technology in 2001 (WiBree) Idea was to address really low-power, embedded connectivity scenarios Watches, sensors, wearables Successfully created the standard and garnered industry participation Merged in to Bluetooth 2007 - known for now as ULP
  34. 34. Market potential - ULP One connection within 50m every minute for three years on a single button cell battery ....within 5m every second for three years on a single button cell battery Source:. Nick Hunn, EZurio, Bluetooth Evolution conference Nov 2007
  35. 35. ULP Scenarios
  36. 36. Ultra Wideband
  37. 37. UWB in Bluetooth
  38. 38. Ultra Wideband
  39. 39. UWB usage HD Video (19 to 24 Mbps HD MPEG2); 18Gb 2 hour movie up/download in 7 minutes ; 1% battery 1 CD Album (10 MP3s) - 1 second 20 Hi rez photos - 1 second
  40. 40. BECI Bluetooth Embedded Control Interface Standardise an interface above the level of Bluetooth Profiles Remove/reduce stack dependency Focus: embedded / automotive markets Potential for re-use in JSR82
  41. 41. Bluetooth Evolution Lots of new stuff going in to Bluetooth Standard Java APIs may be needed to take advantage of the new functionality Bluetooth is moving from Phones (highest volume) to Set Top Boxes, Cars, Copiers, Printers, Medical Devices, ..... Lots of places where Java also lives :-)
  42. 42. Java and Bluetooth Bluetooth Java in devices in devices Home Industrial / M2M Gateway Headsets Medical Sensors Phones Printers STBs Industrial / M2M Home Gateway Cars / OSGi Printers
  43. 43. JSR82 could do with either... A major update to track Bluetooth Evolution OR A Brand new standard that builds on JSR82
  44. 44. Issues - Current JSR82 Learning curve is still high Piconets, Ser vices, Protocols, Profiles, Security Writing your own helper code every time: e.g. Device Discovers and Ser vice Searchers e.g. Marge Project https://marge.dev.java.net/
  45. 45. Enhancements Housekeeping/Admin APIs As per Marge Better abstractions for ease of use Audio Application Specific APIs Gaming, Automotive, Location, Medical UWB and Low-Power Scenarios
  46. 46. Android
  47. 47. Conclusions JSR82 is now “hitting its stride in terms of usage and deployment Excellent potential for follow-on standard Either JSR82++ or a new standard that builds on it... Rococo will propose such a standard in ’08 Interested? Email me: sos@rococosoft.com

×