Download Winsoft USB Library for Android v1.9 Full Source for Delphi/C++ Builder 10 - 11

Winsoft USB Library for Android v1.9 Full Source for Delphi/C++ Builder 10 - 11

Winsoft USB Library for Android v1.9 Full Source for Delphi/C++ Builder 10 - 11
Winsoft USB Library for Android v1.9 Full Source for Delphi/C++ Builder 10 - 11


Delphi and C++ Builder USB and HID library for Android.

uses standard Android USB API
available for Delphi/C++ Builder 10 - 11
source code included in registered version
royalty free distribution in applications

type
TUsbDeviceAttachedEvent = procedure(Sender: TObject; Device: TUsbDevice) of object;
TUsbDeviceDetachedEvent = procedure(Sender: TObject; Device: TUsbDevice) of object;
TUsbPermissionEvent = procedure(Sender: TObject; Device: TUsbDevice; Granted: Boolean) of object;

TUsbManager = class
constructor Create;

property Manager: JUsbManager read;
property Devices: TArray read;
property OnDeviceAttached: TUsbDeviceAttachedEvent read write;
property OnDeviceDetached: TUsbDeviceDetachedEvent read write;
property OnPermission: TUsbPermissionEvent read write;
end;

TUsbDevice = class
function Open: TUsbConnection;
procedure RequestPermission;

property &Class: Integer read;
property ClassName: string read;
property ConfigurationCount: Integer read;
property Configuration[Index: Integer]: TUsbConfiguration read;
property Device: JUsbDevice read;
property HasPermission: Boolean read;
property Id: Integer read;
property InterfaceCount: Integer read;
property &Interface[Index: Integer]: TUsbInterface read;
property Manager: TUsbManager read;
property ManufacturerName: string read;
property Name: string read;
property ProductId: Integer read;
property ProductName: string read;
property Protocol: Integer read;
property SerialNumber: string read;
property Subclass: Integer read;
property VendorId: Integer read;
property Version: string read;
end;

TUsbConfiguration = class
property Id: Integer read;
property InterfaceCount: Integer read;
property MaxPower: Integer read;
property Name: string read;
property IsRemoteWakeup: Boolean read;
property IsSelfPowered: Boolean read;
end;

TUsbInterface = class
property AlternateSetting: Integer read;
property &Class: Integer read;
property ClassName: string read;
property Device: TUsbDevice read;
property EndpointCount: Integer read;
property Endpoint[Index: Integer]: TUsbEndpoint read;
property Id: Integer read;
property IsHid: Boolean read;
property &Interface: JUsbInterface read;
property Name: string read;
property Protocol: Integer read;
property Subclass: Integer read;
end;

TUsbEndpoint = class
property Address: Integer read;
property Attributes: Integer read;
property Direction: TEndpointDirection read;
property Endpoint: JUsbEndpoint read;
property Interval: Integer read;
property MaxPacketSize: Integer read;
property Number: Integer read;
property &Type: TEndpointType read;
end;

TUsbConnection = class
function BulkTransfer(Endpoint: TUsbEndpoint; dаta: Pointer; Length, Timeout: Integer): Integer;
function BulkTransfer(Endpoint: TUsbEndpoint; dаta: TBytes; Timeout: Integer): Integer;
function ClaimInterface(&Interface: TUsbInterface; Force: Boolean): Boolean;
procedure Close;
function ControlTransfer(RequestType, Request, Value, Index: Integer; dаta: TBytes; Timeout: Integer): Integer;
function ControlTransfer(RequestType, Request, Value, Index: Integer; dаta: Pointer; Length: Integer; Timeout: Integer): Integer;
function GetConfigurationDescriptorRequest(Index, LanguageID: Word; Timeout: Integer): TBytes;
function GetConfigurationRequest(Timeout: Integer): Byte;
function GetDescriptorRequest(&Type, Index: Byte; LanguageID: Word; Timeout: Integer): TBytes;
function GetDeviceDescriptor(LanguageID: Word; Timeout: Integer): TDeviceDescriptor;
function GetDeviceDescriptorRequest(LanguageID: Word; Timeout: Integer): TBytes;
function GetFeatureReport(ReportID: Byte; Timeout: Integer): TBytes;
function GetIdle(ReportID: Byte; Timeout: Integer): Byte;
function GetInputReport(ReportID: Byte; Timeout: Integer): TBytes;
function GetLanguageIDs(Timeout: Integer): TLanguageIDs;
function GetProtocol(Timeout: Integer): Byte;
function GetString(Index, LanguageID: Word; Timeout: Integer): string;
function GetStringDescriptorRequest(Index, LanguageID: Word; Timeout: Integer): TBytes;
function ReleaseInterface(&Interface: TUsbInterface): Boolean;
function RequestCancel: Boolean;
procedure RequestClose;
procedure RequestCreate(Endpoint: TUsbEndpoint);
procedure RequestQueueIn(Length: Integer);
procedure RequestQueueOut(dаta: TArray);
function RequestWait(Timeout: Int64 = 0): TArray;
procedure SetConfigurationRequest(Value: Byte; Timeout: Integer);
procedure SetFeatureReport(ReportType, ReportID: Byte; const dаta: TBytes; Timeout: Integer);
procedure SetIdle(ReportID: Byte; Duration: Byte; Timeout: Integer);
procedure SetOutputReport(ReportType, ReportID: Byte; const dаta: TBytes; Timeout: Integer);
procedure SetProtocol(Protocol: Byte; Timeout: Integer);

property Connection: JUsbDeviceConnection read;
property FileDescriptor: Integer read;
property RawDescriptors: TBytes read;
property Request: JUsbRequest read;
property Serial: string read;
end;


Only for V.I.P
Warning! You are not allowed to view this text.
  • 15