[kaffe] Serial Port on Kaffe

Josef Nordangård Josef.Nordangard@ascomtateco.se
Tue, 29 Oct 2002 17:18:11 +0100


The stty command configures the com port. See your manual (may differ on different linux versions).

My settty does the following (I can't remember why :-):
---
stty < $1 $2 $3 $4 $5
---
/Josef

-----Original Message-----
From: Etienne Julien [mailto:j.etienne@quantaflow.com]
Sent: tisdag den 29 oktober 2002 17:00
To: Josef Nordangård; kaffe@kaffe.org
Subject: Re: [kaffe] Serial Port on Kaffe


Thanks for your response Josef.
But can I have more precision about the setty command and these arguments
like -parodd and cstopb ... because I can't find any informations about
these params. My linux (slackware 8.1) indicate command not found.

Thanks a lot
Julien

----- Original Message -----
From: "Josef Nordangård" <Josef.Nordangard@ascomtateco.se>
To: <kaffe@kaffe.org>
Sent: Tuesday, October 29, 2002 4:28 PM
Subject: RE: [kaffe] Serial Port on Kaffe


It is also possible to open the serial port as a file. Init the port using
system calls. A small example for linux:

------------------------
    public Serial(int baudrate, boolean evenparity, int stopbits,
  int charsize) throws FileNotFoundException, IOException{

Runtime rt = Runtime.getRuntime();

// Sets up the port with specified baudrate, parity, stopbits,
// and character size.

if (evenparity)
    parity = "-parodd";
if (stopbits == 2)
    sbits = "cstopb";

String cmd =
    "settty " + comPath + " " +
    baudrate + " " + parity + " " + sbits + " cs" + charsize;
try {
    Process p = rt.exec(cmd);

    if ((p.waitFor()) != 0)
throw new IOException("Error initzialising serial port");
} catch (InterruptedException e) {
    throw new IOException("Error initzialising serial port");
}

out = new BufferedWriter(new FileWriter(comPath), 50);
in = new BufferedReader(new FileReader(comPath), 50);
    }

------------------------

settty is just a small script.

/Josef

-----Original Message-----
From: cfowler [mailto:cfowler@outpostsentinel.com]
Sent: tisdag den 29 oktober 2002 14:37
To: Etienne Julien
Cc: kaffe@kaffe.org
Subject: Re: [kaffe] Serial Port on Kaffe


My belief is that you'll need to resort to using JNI to do this.  Sun
has the Java Communications API for Windows but it use JNI.  Maybe
others have insight on the best method.

Chris


On Tue, 2002-10-29 at 08:03, Etienne Julien wrote:
> Hi,
>
> I'm newbie to kaffe and I want to know if it is possible to use serial
port with it.
> I see a file comm.jar in the share directory but I don't know how to =
use
it.
>
> Thanks for response
>
> Julien



_______________________________________________
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

_______________________________________________
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe