RishiGupta12 / SerialPundit

Serial port communication in Java - FTDI D2XX, HID API, X/Y modem
GNU Affero General Public License v3.0
125 stars 56 forks source link

scm.configureComPortData error #18

Closed LiaanLewis closed 7 years ago

LiaanLewis commented 7 years ago

I am getting an error when using the library on a Raspberry3, connecting to a serial port (/dev/ttyACM0). The error is : Inappropriate ioctl for device when scm.configureComPortControl is called as below. I tested the port with other libraries and it works so I am sure the serial port is set up correctly.

` private void setSerialComms(String portName, BAUDRATE baudRate, DATABITS dataBits, STOPBITS stopBits, PARITY parity, FLOWCONTROL flowControl) {

    System.out.println("Creating serial port : " + portName);

    try {
        scm = new SerialComManager();
        serialPort = scm.openComPort(portName, true, true, false);
        scm.configureComPortData(serialPort, dataBits, stopBits, parity, baudRate, 0);
        scm.configureComPortControl(serialPort, flowControl, 'x', 'x', false, false);
        serialBuffer.clear();
    } catch (IOException e) {
        throw new RuntimeException("Could not open serial port: " + e.toString());
    }

}`
LiaanLewis commented 7 years ago

It seems problem is fixed in latest (1.0.4) on Github