Bluetooth connections with JSR-82

With the JSR-82-based solution, the programmer must be aware of the possible limitations that every component causes. Usually there are restrictions caused by a device driver or Bluetooth software implementations. Limitations at the lowest level affect all levels above it. So, device driver limitations are visible in Bluetooth software and JSR-82 levels.

Figure 141: JSR-82 solution architecture

The bluetooth components are:

Features

Compared to other bluetooth connectivity solutions, JSR-82 offers improved automation of device finding and connecting.

  • Automation

    The JSR-82 API allows automatic device finding and connecting. JSR-82-based software can, for example, run device discovery constantly, automatically create a connection with authorized devices, and do the needed data transfer. At best this does not require any user interaction; it can be an automatic background process.

  • Rich and capable API

    A virtual COM-based solution transfers data between already connected devices. A JSR-82-based solution can handle a list of devices and perform device finding and connection handling — basically, all Bluetooth communication-related tasks.

  • Portability

    By using the JSR-82 API a large amount of code can be shared between Java SE and Java ME implementations.

  • Differences in back-end support

    With Java SE JSR-82 implementations, it is important to remember that all Bluetooth software does not support all the features that the JSR-82 API itself supports. BlueCove that uses Windows XP Service Pack 2 Bluetooth software supports only RFCOMM communications. There is no L2CAP support, which may be a restriction for some applications. Similarly there might be other restrictions with other JSR-82 API implementations.

Requirements

Implementing the JSR-82-based solution requires a Bluetooth device compatible with the Bluetooth stack and software at the computer and the device ends. Windows XP Service Pack 2 Bluetooth stack and Widcomm Bluetooth stack are two examples.

A second needed software component is JSR-82 implementation. Most of the available JSR-82 implementations are specific to a certain Bluetooth stack and software. For example, there are two free JSR-82 API implementations for the Windows XP Service Pack 2 Bluetooth stack: