[kaffe] Problem with rxtx

Fabien Renaud renaud at nentec.de
Wed Jun 9 02:53:03 PDT 2004


Hello !!

I´m still with my problems ;)

Well I don´t think this one is specific to ARM ( I hope, so maybe you´ll 
be able to help me :) )

So, when I want to run a simple sample to communicate with serial 
interface ( I have rxtx lib) I have a lot of things on my screen (which 
seem ok), then this :

RXTX WARNING:  This library was compiled to run with OS release 
2.4.20_dev and you are currently running OS release 2.4.21-rmk2
-pxa1.  In some cases this can be a problem.  Try recompiling RXTX if 
you notice strange behavior.  If you just compiled RXTX m
ake sure /usr/include/linux is a symbolic link to the include files that 
came with the kernel source and not an older copy.

press enter to continue

If I press continue nothing happened.

This is the backtrace :

#0  0x4029939c in *__GI___poll (fds=0xbfffdd28, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:85
#1  0x400cdc58 in handleIO ()
   from /home/java/kaffe/jre/lib/arm/libkaffevm-1.1.4.so
#2  0x400cd924 in reschedule ()
   from /home/java/kaffe/jre/lib/arm/libkaffevm-1.1.4.so
#3  0x400cb380 in suspendOnQThread ()
   from /home/java/kaffe/jre/lib/arm/libkaffevm-1.1.4.so
#4  0x400ce668 in jcondvar_wait ()

With sablevm the program runs when I press enter.

I attach SimpleWrite.java


Someone have ever run rxtx with kaffe ?

Fabien

-------------- next part --------------
import java.io.*;
import java.util.*;
import gnu.io.*;


public class SimpleWrite {
    static Enumeration portList;
    static CommPortIdentifier portId;
    static String messageString = "Hello, world!\n";
    static SerialPort serialPort;
    static OutputStream outputStream;

    public static void main(String[] args) {
        portList = CommPortIdentifier.getPortIdentifiers();
        while ( portList.hasMoreElements() ) {
            portId = (CommPortIdentifier) portList.nextElement();
            if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
                if (portId.getName().equals("/dev/ttyS3")) {
                    try {
                        serialPort = (SerialPort)
			portId.open("SimpleWriteApp", 2000);
			System.out.println("ok");
                    } catch (PortInUseException e) {
			System.out.println("not ok");
		    }
                    try {
                        outputStream = serialPort.getOutputStream();
                    } catch (IOException e) {}
		    System.out.println("test 3");
                    try {
                        serialPort.setSerialPortParams(9600,
                            SerialPort.DATABITS_8,
                            SerialPort.STOPBITS_1,
                            SerialPort.PARITY_NONE);
                    } catch (UnsupportedCommOperationException e) {}
                    try {
                        outputStream.write(messageString.getBytes());
                    } catch (IOException e) {}
		    serialPort.close();
                }
            }
        }
    }
}


More information about the kaffe mailing list