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: JSR-82 solution architecture

The bluetooth components are:

  • Virtual COM port

    The virtual COM port is a software-based COM port. It is created and handled by Bluetooth software and there is no associated hardware present. Normal COM ports are attached to actual hardware, so if a programmer opens the COM1 or COM2 port on a PC, a real COM port is accessed.

    Although the virtual COM is drawn in the above figure as its own component, it is implemented by a Bluetooth software component. Drawing it as its own component makes illustrating the architecture cleaner.

  • JSR-82 API

    The JSR-82 API is implemented over Bluetooth software and/or a device driver on the PC.

  • Bluetooth software

    Bluetooth software publishes API(s) for accessing Bluetooth devices. Bluetooth software allows configuring of Bluetooth — for example, giving a name to a device. The important part is the user interface for managing devices and connections. It is Bluetooth software’s task to offer a user interface for finding other devices and creating pairings.

  • Device driver

    A device driver communicates with the Bluetooth device at the lowest level. A device driver usually implements the Bluetooth protocol stack and other lower-level software components.

  • Operating system

    The operating system runs other software components.

  • Bluetooth device

    A Bluetooth device is physical hardware related to Bluetooth connections. A device is attached to other PC or mobile phone hardware.

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: