Java Socket Interface for Infrared Communication
This Java Infrared Socket API provides a way of communicating
through infrared medium on a Linux computer using the Java
language. Thus, Java application developers can develop applications
involving infrared access much easily.
The Java IrDA API is another Open Source project from HP, again
built thanks to contributions from the community. The API was
initially written by A.Venkataramani thanks to Hewlett Packard sponsoring his work.
The API is very similar to java.net.Socket API and has been
implemented using the Linux-IrDA stack (version
included in kernel 2.4.0 and above).
The API is also interoperable with Microsoft Windows 98,
Windows 2000 and Windows CE IrSock, and with Linux-IrDA IrSock. Hence,
the peer for this API could be an application running on a WinCE
device such as HP Jornada
540/720/820 or on a Windows/Linux
The specification of the API is not Linux-specific, so it would be
possible to offer the same API on a variety of platforms, and have
Java-IrDA applications run anywhere. However, the present
package is implemented on top of Linux-IrDA IrSock and uses a few
Linux-specific features, so the low level part of the package
would need some slight changes for other platforms.
Both connection oriented streams (IrSocket and
IrServerSocket) and connectionless Ultra
(UltraSocket and UltraPacket) interfaces are
available. Sequenced packets and datagrams sockets are
not implemented, because rarely used, but would be easy to add
The API has been tested out on Linux
RedHat 6.1 and GNU/Linux Debian
2.2 running Blackdown JDK 1.2
and 1.2.2, both using a serial to Infrared dongle.
This API is defined directly on top of the Linux kernel, but of course you
will need the Linux-IrDA stack up and running.
This API is distributed under the terms of the GNU
Lesser General Public License.
See the INSTALL and README files included in the .tar.gz file.
The Java-IrDA API require the IrDA stack in kernel 2.4.0. I've
got also basic installation
instructions for this version of the Linux-IrDA stack.
Communication with a Palm
The main question that I get about this API is how to use it to
communicate with a Palm device. I'll try to answer...
The Palm mostly uses a protocol called Obex to exchange various
objects (business cards, appointements, ...). Obex is a standard IrDA
protocol implemented on top of the IrDA sockets, and that is
more or less a compressed version of HTTP.
There exist some implementation of Obex for Linux and Win32 written in
C, the most popular beeing OpenObex. But, of
course, you want to do your coding in Java. We have looked in doing a
JNI wrapper around the OpenObex library, but I must admit that the
OpenObex API is not appropriate for this.
The other solution is to do an implementation of Obex in Java,
written on top of the Java-IrDA API. In fact, the JRed project already
contains a cut down version of Obex written in Java, and it should be
an easy task to port it over our API. Another project that may have an
Obex implementation in Java in the future is Jir.
If you find any bugs, have suggestions, please contact A.Venkataramani
(email@example.com) or Jean
IrNET and e-Squirt
e-Squirt is one of the main protocol used in Cooltown. One of the main use of
the Java-IrDA API was to offer a way to use e-Squirt in Java
applications. I also did some sample e-Squirt
implementations for Linux in C.
You might also be interested in IrNET, a
module allowing you to transport TCP/IP over an IrDA socket. This
would allow you to use regular TCP/IP sockets in Java over
This package is an offshoot of the Cooltown
Appliance Computing project of Hewlett Packard Laboratories.
Enjoy Beaming with Java!
Main Page -
Wireless LANs -
- Created February 10th, 2000