Hello,

Sorry for the repost, but I wasn't sure which forum this question would be more relivant too.

Has anyone got serial communications to work in the Nokia Developers Suite using any emulators? It's very imprtant for us to get a mobile phone that can communicate with an external device through the serial port. Preferably in Java. Is there any way for us to do this?


I have been trying for quite some time to get serial communications to work in the Series 60 MIDP Concept SDK Beta 0.3 Nokia edition (and 0.31). So far I have had no luck.

The program is simple. Actually, it is straight out of the MIDP 2.0 API. Here is the relevant code fragment:

CommConnection cc = (CommConnection)
Connector.open("comm:0;baudrate=4800");

InputStream is = cc.openInputStream();
int ch = 0;
while(ch != 'Z') {
ch = is.read();
ch++;
}
is.close();
cc.close();


The offending line of code is:

CommConnection cc = (CommConnection)
Connector.open("comm:0;baudrate=4800");

With Nokia-DS, this causes a "protocol does not exist" error.
In JWT this works perfectly.

Both are using MIDP 2.0.

I have done allot of digging. I've tried rewriting the connection string every way I could find on the net. And have had no luck.

I even tried bypassing the Connector.open command, directly writing:

Class clazz = Class.forName("com.sun.midp.io.j2me.comm.Protocol");
ConnectionBaseInterface uc = (ConnectionBaseInterface)clazz.newInstance();
CommConnection cc = (CommConnection) uc.openPrim("comm:0;baudrate=4800", Connector.READ_WRITE, false);

This got me further, as when I ran this code the emulator got to the point where it asked me if it was okay to establish a connection via the serial port. However, after selecting "yes" I get an "cannot open port" error. This error is actually coming from a c program inside the SDK called commProtocol_md.c. This error is followed by a java IOException that points to an irrelevant line of code.

After saying all this, I ask again... has anyone got serial communications to work in the Nokia Developers Suite using any emulators at all? Does anyone have any idea what I might be doing wrong?

Please let me know if you got serial communications to work.

I would greatly appreciate your assistance on this matter.

Thank you for your time.
jp