USBUART
A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
Channel.java
Go to the documentation of this file.
1 
5 /* This file is part of USBUART Library. http://usbuart.info/
6  *
7  * Copyright (C) 2016 Eugene Hutorny <eugene@hutorny.in.ua>
8  *
9  * The USBUART Library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License v2
11  * as published by the Free Software Foundation;
12  *
13  * The USBUART Library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with the USBUART Library; if not, see
20  * <http://www.gnu.org/licenses/gpl-2.0.html>.
21  */
22 
23 package info.usbuart.api;
24 
25 import java.io.InputStream;
26 import java.io.OutputStream;
27 
31 public interface Channel {
32  class status_t {
33  public final int read_pipe_ok = 1;
34  public final int write_pipe_ok = 2;
35  public final int usb_dev_ok = 4;
36  public final int alles_gute = read_pipe_ok | write_pipe_ok | usb_dev_ok;
37  }
38  class Error extends Exception {
39  Error(String msg) { super(msg); }
40  }
41  InputStream getInputStream() throws Error;
42  OutputStream getOutputStream() throws Error;
43  void reset() throws Error;
44  void sendBreak() throws Error;
45  void close();
46  int status();
47 }
An interface for accessing a USB-UART device via I/O streams.
Definition: Channel.java:31