Sunday, June 01, 2008

My Thesis - Literature Study - JSR 82

JSR stands for Java Specification Request. It is the actual descriptions of proposed and final specifications for the Java platform. According to Motorola’s JSR-82 specification document [1], JSR-82 is a J2ME Application Programming Interface (API) for Bluetooth environment. It enables Java applications to interact using Bluetooth technology. Having this, application developers will not need to bother about the hardware stack of the Bluetooth Protocol Stacks. Instead, they only need to deal with the software stack.

Moreover, JSR-82 provides following capabilities:
  • Register and publish services
  • Discover devices and services
  • Establish connection between devices
  • Send and retrieve data
  • Manage and control the communication connections
  • Provide security for the activities mentioned above

Particularly, JSR-82 provides device-management capabilities by providing two classes, LocalDevice and RemoteDevice. Both classes can help application to get information about devices. Methods of getLocalDevice() and getRemoteDevice() can respectively get local device and remote device as objects. Both classes also provides getBluetoothAddress() and getFriendlyName() to get the Bluetooth address of the device and retrieve the name of the Bluetooth device respectively.

In order to make a connection, one device should initiate the connection. On the client side, JSR-82 provides DiscoveryAgent class in order to find nearby active Bluetooth devices by using startInquiry() method. After active devices are found, it can begin to search for available services using the searchServices() method.

On the server side, it has the responsibility to publish its services, allowing clients to see and consume available services. To provide server with this capability, JSR-82 allows Bluetooth server device:
  • To create and publish services using Connector.open() method.
  • To add services to the Service Discovery Database (SDDB) using LocalDevice.getRecord() method.
  • To update any changes on SDDB using LocalDevice.updateRecord() method.
  • To wait and accept any incoming client connections using StreamConnectionNotifier.acceptAndOpen() method.
  • To remove services from SDDB using StreamConnectionNotifier.close() method when it is no longer needed.
Reference:
[1] Java APIs for Bluetooth Wireless Technology (JSR 82), Motorola. JABWT-Spec.pdf.

No comments: