开发者

NoSuchPortException problem for serial port

I tried to connect to SerialPort COM6 using (Windows XP) javax.comm library with this piece of code

portId = CommPortIdentifier.getPortIdentifier(commName);
        port = portId.open("", Integer.parseInt(timeout));
        serialPort = (SerialPort) port;
        serialPort.setSerialPortParams(Integer.parseInt(baudRate), SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

but I got exception NoSuchPortException开发者_运维问答 and error

Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String;)I while loading driver com.sun.comm.SolarisDriver
Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path

What is wrong with this ? Can anybody please help ?


The implementation of this API is not available on all platforms.


you need to use rxtx libraries for windows.

http://rxtx.qbang.org/wiki/index.php/FAQ

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜