Package com.fazecast.jSerialComm.android
Class AndroidPort
java.lang.Object
com.fazecast.jSerialComm.android.AndroidPort
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static android.app.Applicationprotected final byte[]protected intprotected intprotected intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected android.hardware.usb.UsbDeviceConnectionprotected final android.hardware.usb.UsbDeviceprotected android.hardware.usb.UsbEndpointprotected android.hardware.usb.UsbEndpointprotected android.hardware.usb.UsbInterfaceprotected static android.hardware.usb.UsbManagerprotected final byte[]protected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intabstract intabstract booleanabstract booleanclearDTR()abstract booleanclearRTS()abstract booleanlongabstract booleanconfigPort(SerialPort serialPort) abstract booleanstatic SerialPort[]abstract booleangetCTS()abstract booleangetDCD()abstract booleangetDSR()abstract booleangetDTR()abstract intabstract intabstract booleangetRI()abstract booleangetRTS()protected static longmakeVidPid(int vid, int pid) abstract booleanopenPort()longopenPortNative(SerialPort serialPort) abstract intreadBytes(byte[] buffer, long bytesToRead, long offset, int timeoutMode, int readTimeout) static voidsetAndroidContext(Object androidContext) abstract booleansetBreak()abstract booleansetDTR()abstract voidsetEventListeningStatus(boolean eventListenerRunning) abstract booleansetRTS()abstract intabstract intwriteBytes(byte[] buffer, long bytesToWrite, long offset, int timeoutMode)
-
Field Details
-
USB_REQUEST_TYPE_STANDARD
protected static final int USB_REQUEST_TYPE_STANDARD- See Also:
-
USB_REQUEST_TYPE_CLASS
protected static final int USB_REQUEST_TYPE_CLASS- See Also:
-
USB_REQUEST_TYPE_VENDOR
protected static final int USB_REQUEST_TYPE_VENDOR- See Also:
-
USB_REQUEST_TYPE_RESERVED
protected static final int USB_REQUEST_TYPE_RESERVED- See Also:
-
USB_ENDPOINT_IN
protected static final int USB_ENDPOINT_IN- See Also:
-
USB_ENDPOINT_OUT
protected static final int USB_ENDPOINT_OUT- See Also:
-
USB_RECIPIENT_DEVICE
protected static final int USB_RECIPIENT_DEVICE- See Also:
-
USB_RECIPIENT_INTERFACE
protected static final int USB_RECIPIENT_INTERFACE- See Also:
-
USB_RECIPIENT_ENDPOINT
protected static final int USB_RECIPIENT_ENDPOINT- See Also:
-
USB_RECIPIENT_OTHER
protected static final int USB_RECIPIENT_OTHER- See Also:
-
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
-
-
Constructor Details
-
AndroidPort
protected AndroidPort(android.hardware.usb.UsbDevice device)
-
-
Method Details
-
setAndroidContext
-
getCommPortsNative
-
openPortNative
-
closePortNative
public long closePortNative() -
makeVidPid
protected static long makeVidPid(int vid, int pid) -
openPort
public abstract boolean openPort() -
closePort
public abstract boolean closePort() -
configPort
-
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()
-