aspose file tools*
The moose likes Java Micro Edition and the fly likes Connecting to Serial Port on Motorola i85s Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Connecting to Serial Port on Motorola i85s" Watch "Connecting to Serial Port on Motorola i85s" New topic
Author

Connecting to Serial Port on Motorola i85s

Wayne Pau
Greenhorn

Joined: Jun 14, 2002
Posts: 3
Hi,
I'm just about to dev some stuff for a contract using this IDen phone. I'm doing my research now and I can't find any more information on Serial Port connection other than the connection string.
ie. "comm:0;baudrate=4800;stopbits=1;parity=n;databits=8;flowcontrol=n/n;"
but what about the reading protocol? This one J2ME book on connection framework went into HTTP, socket and this other protocol, but nothing on the "comm". Is it just like reading from any other stream in J2ME?
Does anyone know anymore about this? Has anyone tried reading from the serial port? Does the phone have a buffer?
I'm newbie, so go easy. If anyone has done this, give me info or point in the right direction I'd be super thankful,
thanks,
w.
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
this might help, as might the previous discussion about IOExceptions:
http://forum.java.sun.com/thread.jsp?forum=50&thread=265834
Wayne Pau
Greenhorn

Joined: Jun 14, 2002
Posts: 3
Hey guys,
I got the COMM to work.
these are the few things I've learned.
1. The emulator doesn't really work for comm port testing. You really need to put it down to the phone, since the phone doesn't really have serial port access if HyperTerminal in availiable.
2. there are a few connection stream examples availiable.. but for the i85s, this one works.
String parameter = "comm:0;baudrate=9600;stopbits=1;parity=e;databits=7;flowcontrol=s/s;";
The one I got from Ericsson didn't seem to work.
3. I'm stil having trouble with matching the stuff coming down the serial steam to the datastream. I'm getting a 'Z' down the pipe when I'm using HyperTermninal and it's great... however when I'm using my other serial device.. which on HyperTerminal shows 'Z', the phone doesn't see it.
sc = (StreamConnection) Connector.open(parameter, Connector.READ_WRITE, false);
is = sc.openInputStream();
os = sc.openOutputStream();
ch = 0;
while (ch != 'Z')
{
ch = is.read();
b.append((char) ch);
}
sMessage = b.toString();
(doesn't get out of loop.. because it doesn't get the 'Z')
if anyone has more info about 3.. pls let me know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to Serial Port on Motorola i85s