2013年9月2日星期一

Serial port to send data failed Win32SerialPort

Exception information:
java.io.IOException: write error
at com.sun.comm.Win32SerialPort.write (Wri32SerialPort.java: 677)
at com.sun.comm.Win32SerialOutputStream.write (Win32SerialOutputStream.java: 38)
at tempbaseserver.hw.develop.core.SerialBean.WriteBytePort (SerialBean.java87)
Code:
    public void WriteBytePort(byte b[]) {
        try {
            System.out.println("out = " + out + "  sb = " + sb);
            if (sb == null) {
                Initialize(fPortName, fPortRate);
                System.out.println("writeByteprot初始化");
            }
            out.write(b);
        } catch (Exception e) {
            System.out.println("写入数据异常" + e);
        }
    }

red part of the report the exception code
sometimes even appear to connect this exception , sometimes even normal , it is unclear exactly where there is a problem ,
you have expert guidance

------ Solution ------------------------------------ --------
check the connections and flow state , to see if they are turned off
------ Solution --------------- Results posted -----------------------------
Shashi Hou ah
------ For reference only - --------------------------------------

found the problem , is because the computer has to attach to restore Wizard , ruining my JAVA environment , reloading of the environment do not have this problem
------ For reference only ------------ ---------------------------

sorry, forgot to settle a busy stickers , give you points

没有评论:

发表评论