Android Open Source - UsbSerial Usb Serial Interface






From Project

Back to project page UsbSerial.

License

The source code is released under:

MIT License

If you think the Android project UsbSerial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.felhr.usbserial;
/*from   www.jav a 2s.co m*/
/**
 * Interface to handle a serial port
 * @author felhr (felhr85@gmail.com)
 *
 */
public interface UsbSerialInterface 
{
  // Common values
  public static final int DATA_BITS_5 = 5;
  public static final int DATA_BITS_6 = 6;
  public static final int DATA_BITS_7 = 7;
  public static final int DATA_BITS_8 = 8;
  
  public static final int STOP_BITS_1 = 1;
  public static final int STOP_BITS_15 = 3;
  public static final int STOP_BITS_2 = 2;
  
  public static final int PARITY_NONE = 0;
  public static final int PARITY_ODD = 1;
  public static final int PARITY_EVEN = 2;
  public static final int PARITY_MARK = 3;
  public static final int PARITY_SPACE = 4;
  
  public static final int FLOW_CONTROL_OFF = 0;
  public static final int FLOW_CONTROL_RTS_CTS= 1;
  public static final int FLOW_CONTROL_DSR_DTR = 2;
  public static final int FLOW_CONTROL_XON_XOFF = 3;
  
  // Common Usb Serial Operations (I/O Asynchronous)
  public boolean open();
  public void write(byte[] buffer);
  public int read(UsbReadCallback mCallback);
  public void close();
  
  // Serial port configuration
  public void setBaudRate(int baudRate);
  public void setDataBits(int dataBits);
  public void setStopBits(int stopBits);
  public void setParity(int parity);
  public void setFlowControl(int flowControl);
  
  // Usb Read Callback
  public interface UsbReadCallback
  {
    public void onReceivedData(byte[] data);
  }
  
}




Java Source Code List

com.felhr.deviceids.CP210xIds.java
com.felhr.deviceids.FTDISioIds.java
com.felhr.deviceids.PL2303Ids.java
com.felhr.usbserial.BLED112SerialDevice.java
com.felhr.usbserial.CDCSerialDevice.java
com.felhr.usbserial.CP2102SerialDevice.java
com.felhr.usbserial.FTDISerialDevice.java
com.felhr.usbserial.PL2303SerialDevice.java
com.felhr.usbserial.SerialBuffer.java
com.felhr.usbserial.UsbSerialDebugger.java
com.felhr.usbserial.UsbSerialDevice.java
com.felhr.usbserial.UsbSerialInterface.java
com.felhr.utils.HexData.java