Driver

The LED driver is a Java API to send commands to the Firmware and getting notified about feedback from the firmware.

Communication

The client software talks to the Arduino board through a serial port connection. For this purpose the RXTX interface is used. In order to check whether the connection is still established, the driver periodically sends a ping to the board. Once this connection is interrupted for several reasons, it’s assumed the connection is dead.

Protocol

The driver implements the LED Protocol.

Deployment

The driver is deployed as *.jar file into the softwares lib/ folder.

../_images/driver_export.png ../_images/driver_export_dialog.png

Note: This is not ideal and must be triggered manually. Better solutions are welcome.

Remarks

There is a rxtx wiki entry describing how to bundle the jni extension with an eclipse rcp application.

Mac OS X

The normal distributed librxtxSerial.jnilib is only in 32-bit mode which doesn’t match a 64-bit processor architecture and can thus not be autoloaded. See here:

$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 2 architectures
librxtxSerial.jnilib (for architecture ppc):  Mach-O dynamically linked shared library ppc
librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386

Luckily there is a 64-bit version available, forged by Robert Harder. The eclipse plugin distributes the 64-bit version mentioned here:

$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 4 architectures
librxtxSerial.jnilib (for architecture x86_64):       Mach-O 64-bit bundle x86_64
librxtxSerial.jnilib (for architecture i386): Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc7400):      Mach-O bundle ppc
librxtxSerial.jnilib (for architecture ppc64):        Mach-O 64-bit bundle ppc64

Disconnecting

There are some problems between RXTX and properly disconnecting connections. The problems are described in a forum thread. The mentioned hacks are implemented precautionally. Probably RXTX version 2.2 should have these issues resolved, yet wasn’t available stable at the time of implementation.