Package com.fazecast.jSerialComm.android
Class AndroidPort
- java.lang.Object
-
- com.fazecast.jSerialComm.android.AndroidPort
-
public abstract class AndroidPort extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static android.app.Application
context
protected byte[]
readBuffer
protected int
readBufferIndex
protected int
readBufferLength
protected int
readBufferOffset
protected static int
USB_ENDPOINT_IN
protected static int
USB_ENDPOINT_OUT
protected static int
USB_RECIPIENT_DEVICE
protected static int
USB_RECIPIENT_ENDPOINT
protected static int
USB_RECIPIENT_INTERFACE
protected static int
USB_RECIPIENT_OTHER
protected static int
USB_REQUEST_TYPE_CLASS
protected static int
USB_REQUEST_TYPE_RESERVED
protected static int
USB_REQUEST_TYPE_STANDARD
protected static int
USB_REQUEST_TYPE_VENDOR
protected android.hardware.usb.UsbDeviceConnection
usbConnection
protected android.hardware.usb.UsbDevice
usbDevice
protected android.hardware.usb.UsbEndpoint
usbDeviceIn
protected android.hardware.usb.UsbEndpoint
usbDeviceOut
protected android.hardware.usb.UsbInterface
usbInterface
protected static android.hardware.usb.UsbManager
usbManager
protected byte[]
writeBuffer
protected int
writeBufferIndex
protected int
writeBufferLength
-
Constructor Summary
Constructors Modifier Constructor Description protected
AndroidPort(android.hardware.usb.UsbDevice device)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
bytesAvailable()
abstract int
bytesAwaitingWrite()
abstract boolean
clearBreak()
abstract boolean
clearDTR()
abstract boolean
clearRTS()
abstract boolean
closePort()
long
closePortNative()
abstract boolean
configPort(SerialPort serialPort)
abstract boolean
flushRxTxBuffers()
static SerialPort[]
getCommPortsNative()
abstract boolean
getCTS()
abstract boolean
getDCD()
abstract boolean
getDSR()
abstract boolean
getDTR()
abstract int
getLastErrorCode()
abstract int
getLastErrorLocation()
abstract boolean
getRI()
abstract boolean
getRTS()
protected static long
makeVidPid(int vid, int pid)
abstract boolean
openPort()
long
openPortNative(SerialPort serialPort)
abstract int
readBytes(byte[] buffer, long bytesToRead, long offset, int timeoutMode, int readTimeout)
static void
setAndroidContext(Object androidContext)
abstract boolean
setBreak()
abstract boolean
setDTR()
abstract void
setEventListeningStatus(boolean eventListenerRunning)
abstract boolean
setRTS()
abstract int
waitForEvent()
abstract int
writeBytes(byte[] buffer, long bytesToWrite, long offset, int timeoutMode)
-
-
-
Field Detail
-
USB_REQUEST_TYPE_STANDARD
protected static final int USB_REQUEST_TYPE_STANDARD
- See Also:
- Constant Field Values
-
USB_REQUEST_TYPE_CLASS
protected static final int USB_REQUEST_TYPE_CLASS
- See Also:
- Constant Field Values
-
USB_REQUEST_TYPE_VENDOR
protected static final int USB_REQUEST_TYPE_VENDOR
- See Also:
- Constant Field Values
-
USB_REQUEST_TYPE_RESERVED
protected static final int USB_REQUEST_TYPE_RESERVED
- See Also:
- Constant Field Values
-
USB_ENDPOINT_IN
protected static final int USB_ENDPOINT_IN
- See Also:
- Constant Field Values
-
USB_ENDPOINT_OUT
protected static final int USB_ENDPOINT_OUT
- See Also:
- Constant Field Values
-
USB_RECIPIENT_DEVICE
protected static final int USB_RECIPIENT_DEVICE
- See Also:
- Constant Field Values
-
USB_RECIPIENT_INTERFACE
protected static final int USB_RECIPIENT_INTERFACE
- See Also:
- Constant Field Values
-
USB_RECIPIENT_ENDPOINT
protected static final int USB_RECIPIENT_ENDPOINT
- See Also:
- Constant Field Values
-
USB_RECIPIENT_OTHER
protected static final int USB_RECIPIENT_OTHER
- See Also:
- Constant Field Values
-
context
protected static android.app.Application context
-
usbManager
protected static android.hardware.usb.UsbManager usbManager
-
usbDevice
protected final android.hardware.usb.UsbDevice usbDevice
-
usbInterface
protected android.hardware.usb.UsbInterface usbInterface
-
usbConnection
protected android.hardware.usb.UsbDeviceConnection usbConnection
-
usbDeviceIn
protected android.hardware.usb.UsbEndpoint usbDeviceIn
-
usbDeviceOut
protected android.hardware.usb.UsbEndpoint usbDeviceOut
-
writeBufferIndex
protected volatile int writeBufferIndex
-
writeBufferLength
protected volatile int writeBufferLength
-
readBufferIndex
protected volatile int readBufferIndex
-
readBufferOffset
protected volatile int readBufferOffset
-
readBufferLength
protected volatile int readBufferLength
-
readBuffer
protected final byte[] readBuffer
-
writeBuffer
protected final byte[] writeBuffer
-
-
Method Detail
-
setAndroidContext
public static void setAndroidContext(Object androidContext)
-
getCommPortsNative
public static SerialPort[] getCommPortsNative()
-
openPortNative
public long openPortNative(SerialPort serialPort)
-
closePortNative
public long closePortNative()
-
makeVidPid
protected static long makeVidPid(int vid, int pid)
-
openPort
public abstract boolean openPort()
-
closePort
public abstract boolean closePort()
-
configPort
public abstract boolean configPort(SerialPort serialPort)
-
flushRxTxBuffers
public abstract boolean flushRxTxBuffers()
-
waitForEvent
public abstract int waitForEvent()
-
bytesAvailable
public abstract int bytesAvailable()
-
bytesAwaitingWrite
public abstract int bytesAwaitingWrite()
-
readBytes
public abstract int readBytes(byte[] buffer, long bytesToRead, long offset, int timeoutMode, int readTimeout)
-
writeBytes
public abstract int writeBytes(byte[] buffer, long bytesToWrite, long offset, int timeoutMode)
-
setEventListeningStatus
public abstract void setEventListeningStatus(boolean eventListenerRunning)
-
setBreak
public abstract boolean setBreak()
-
clearBreak
public abstract boolean clearBreak()
-
setRTS
public abstract boolean setRTS()
-
clearRTS
public abstract boolean clearRTS()
-
setDTR
public abstract boolean setDTR()
-
clearDTR
public abstract boolean clearDTR()
-
getCTS
public abstract boolean getCTS()
-
getDSR
public abstract boolean getDSR()
-
getDCD
public abstract boolean getDCD()
-
getDTR
public abstract boolean getDTR()
-
getRTS
public abstract boolean getRTS()
-
getRI
public abstract boolean getRI()
-
getLastErrorLocation
public abstract int getLastErrorLocation()
-
getLastErrorCode
public abstract int getLastErrorCode()
-
-