I'm trying to develop a J2ME app which is using a cell phone's IR port to communicate with an external device. It would be nice to get this to work on any cell phone which has an infrared port, but I've buried that hope already. For starters, my Nokia E 50, which is an S 60 third ed. device would suffice.
Alas, so far I did't get anywhere.
What I'm trying to do is approximately this:
comm = (CommConnection)Connector.open("comm:IR0", Connector.READ_WRITE, false);
os = comm.openOutputStream();
String text = "Hello World";
Now, I do appear to have an IR0 port (at least System.getProperty("microedition.commports") returns IR0, among others), and according to some docs I've found this means that the cell phone supports IRCOMM. Fine so far.
However, while I can apparently open the connection and the stream, I don't get any data transferred. The cell phone asks me if I want to allow the connection, and that's pretty much all that happens. I also don't get any exceptions or such.
I've got an IR-USB-Dongle connected to my PC, and when I launch an app which dumps IR traffic to a console window, I can see device discovery going on ... my PC and the cell phone announcing their presence, but not much else.
So: am I missing something, or is my IR0 port "bogus" and I cannot use IR from J2ME?