[kaffe] Serial Port on Kaffe
cfowler
cfowler@outpostsentinel.com
29 Oct 2002 11:18:59 -0500
stty is the command you are looking for.
On Tue, 2002-10-29 at 11:00, Etienne Julien wrote:
> 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.
>=20
> Thanks a lot
> Julien
>=20
> ----- Original Message -----
> From: "Josef Nordang=E5rd" <Josef.Nordangard@ascomtateco.se>
> To: <kaffe@kaffe.org>
> Sent: Tuesday, October 29, 2002 4:28 PM
> Subject: RE: [kaffe] Serial Port on Kaffe
>=20
>=20
> It is also possible to open the serial port as a file. Init the port usin=
g
> system calls. A small example for linux:
>=20
> ------------------------
> public Serial(int baudrate, boolean evenparity, int stopbits,
> int charsize) throws FileNotFoundException, IOException{
>=20
> Runtime rt =3D Runtime.getRuntime();
>=20
> // Sets up the port with specified baudrate, parity, stopbits,
> // and character size.
>=20
> if (evenparity)
> parity =3D "-parodd";
> if (stopbits =3D=3D 2)
> sbits =3D "cstopb";
>=20
> String cmd =3D
> "settty " + comPath + " " +
> baudrate + " " + parity + " " + sbits + " cs" + charsize;
> try {
> Process p =3D rt.exec(cmd);
>=20
> if ((p.waitFor()) !=3D 0)
> throw new IOException("Error initzialising serial port");
> } catch (InterruptedException e) {
> throw new IOException("Error initzialising serial port");
> }
>=20
> out =3D new BufferedWriter(new FileWriter(comPath), 50);
> in =3D new BufferedReader(new FileReader(comPath), 50);
> }
>=20
> ------------------------
>=20
> settty is just a small script.
>=20
> /Josef
>=20
> -----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
>=20
>=20
> 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.
>=20
> Chris
>=20
>=20
> 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 us=
e
> it.
> >
> > Thanks for response
> >
> > Julien
>=20
>=20
>=20
> _______________________________________________
> kaffe mailing list
> kaffe@kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>=20
> _______________________________________________
> kaffe mailing list
> kaffe@kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>=20
>=20
> _______________________________________________
> kaffe mailing list
> kaffe@kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>=20
>=20