ComPort for Android USB Serial 1.7 Delphi/CBB XE6-10.1 Full Source
Delphi and C++ Builder serial communication library for USB serial devices for Android.
FEATURES
Uses UsbSerial library
Suports CP210x, CP2130, CDC, FTDI, PL2303 and CH34x devices
No special root access privileges needed
Available for Delphi/C++ Builder XE6 - 10.1
Source code included in full version
Royalty free distribution in applications
API
type
JUsbSerialInterface_UsbBreakCallback = interface(IJavaInstance)
procedure onBreakInterrupt;
end;
JUsbSerialInterface_UsbCTSCallback = interface(IJavaInstance)
procedure onCTSChanged(State: Boolean);
end;
JUsbSerialInterface_UsbDSRCallback = interface(IJavaInstance)
procedure onDSRChanged(State: Boolean);
end;
JUsbSerialInterface_UsbFrameCallback = interface(IJavaInstance)
procedure onFramingError;
end;
JUsbSerialInterface_UsbOverrunCallback = interface(IJavaInstance)
procedure onOverrunError;
end;
JUsbSerialInterface_UsbParityCallback = interface(IJavaInstance)
procedure onParityError;
end;
JUsbSerialInterface_UsbReadCallback = interface(IJavaInstance)
procedure onReceivedData(data: TJavaArray<Byte>);
end;
JUsbSerialInterfaceClass = interface(IJavaClass)
property DATA_BITS_5: Integer;
property DATA_BITS_6: Integer;
property DATA_BITS_7: Integer;
property DATA_BITS_8: Integer;
property FLOW_CONTROL_DSR_DTR: Integer;
property FLOW_CONTROL_OFF: Integer;
property FLOW_CONTROL_RTS_CTS: Integer;
property FLOW_CONTROL_XON_XOFF: Integer;
property PARITY_EVEN: Integer;
property PARITY_MARK: Integer;
property PARITY_NONE: Integer;
property PARITY_ODD: Integer;
property PARITY_SPACE: Integer;
property STOP_BITS_1: Integer;
property STOP_BITS_15: Integer;
property STOP_BITS_2: Integer;
end;
JUsbSerialInterface = interface(IJavaInstance)
procedure close;
procedure getBreak(breakCallback: JUsbSerialInterface_UsbBreakCallback);
procedure getCTS(ctsCallback: JUsbSerialInterface_UsbCTSCallback);
procedure getDSR(dsrCallback: JUsbSerialInterface_UsbDSRCallback);
procedure getFrame(frameCallback: JUsbSerialInterface_UsbFrameCallback);
procedure getOverrun(overrunCallback: JUsbSerialInterface_UsbOverrunCallback);
procedure getParity(parityCallback: JUsbSerialInterface_UsbParityCallback);
function open: Boolean;
function &read(readCallback: JUsbSerialInterface_UsbReadCallback): Integer;
procedure setBaudRate(baudRate: Integer);
procedure setDataBits(dataBits: Integer);
procedure setDTR(state: Boolean);
procedure setFlowControl(flowControl: Integer);
procedure setParity(parity: Integer);
procedure setRTS(state: Boolean);
procedure setStopBits(stopBits: Integer);
procedure syncClose;
function syncOpen: Boolean;
function syncRead(buffer: TJavaArray<Byte>; timeout: Integer): Integer;
function syncWrite(buffer: TJavaArray<Byte>; timeout: Integer): Integer;
procedure &write(buffer: TJavaArray<Byte>);
end;
Version 1.7
updated to the newest UsbSerial librarye
updated to the newest UsbSerial librarye