3.6. Alternatives

The main purpose of PyBluez is to allow Bluetooth programmers to quickly and easily develop and deploy Bluetooth applications. By providing high level objects and methods, PyBluez allows the programmer to focus on designing the algorithm and structure of the program instead having to worry about syntactic details, memory management, and parsing complex data structures and byte strings. PyBluez is not the only, or first, high level Bluetooth implementation with this goal.

3.6.1. Java

There are a number of Java bindings for Bluetooth programming currently available. The Java community has the advantage of having standardized on an API for Bluetooth development, called JSR-82. Almost all Java Bluetooth implementations adhere to this specification. This makes porting Bluetooth applications from one device to another much simpler. Current implementations of JSR-82 for the GNU/Linux operating system include Rocosoft Impronto [1], Avetana [2], and JavaBluetooth [3].

A disadvantage of using Java is that JSR-82 is very limited, providing virtually no control over the device discovery process or established data connections. For example, JSR-82 provides no method for adjusting delivery semantics, flushing a cache of previously detected devices during a device discovery, or obtaining signal strength information [4]. While JSR-82 is acceptable for creating simple Bluetooth applications, it is not well suited for research and academic purposes. Furthermore, Java and many JSR-82 implementations are not available on a number of platforms.

3.6.2. PyAffix

PyAffix [5] is also a Python extension module for GNU/Linux that provides access to system Bluetooth resources. Unlike PyBluez, PyAffix is written for the Affix Bluetooth protocol stack, which is an alternative Bluetooth implementation for GNU/Linux. BlueZ is the official Bluetooth protocol stack for GNU/Linux, and almost all Linux distributions are shipped with BlueZ. In order to use PyAffix, the user must first remove BlueZ and install Affix - a complex and laborious process requiring a high level of expertise. PyBluez originated as a port of PyAffix for BlueZ, and grew to provide functionality not present in PyAffix.

Notes

[1]

http://www.rocosoft.com

[2]

http://www.avetana-gmbh.de/avetana-gmbh/produkte/jsr82.eng.xm

[3]

http://www.javabluetooth.org

[4]

Cache flushing and signal strength were not covered in this chapter, but are described in the PyBluez documentation and examples

[5]

http://affix.sourceforge.net/pyaffix.shtml