- public OutputStream getOutputStream() { return out; }
- public InputStream getInputStream() { return in; }
-
- public FtdiUart(int vendor, int product, int baud) {
- example.ftdi_init(context);
- example.ftdi_usb_open(context, vendor, product);
- example.ftdi_usb_reset(context);
- example.ftdi_set_baudrate(context, baud);
- example.ftdi_set_line_property(context, 8, 0, 0);
+ public FtdiUart(int vendor, int product, int baud) throws IOException {
+ FtdiUartNative.ftdi_init(context);
+ FtdiUartNative.ftdi_usb_open(context, vendor, product);
+ FtdiUartNative.ftdi_usb_reset(context);
+ FtdiUartNative.ftdi_set_baudrate(context, baud);
+ FtdiUartNative.ftdi_set_line_property(context, 8, 0, 0);
+ FtdiUartNative.ftdi_setflowctrl(context, (1<<8));