{*******************************************************}
{                                                       }
{       nrCommLib Communication Library for Delphi      }
{       Base abstract class for Usb API                 }
{       Copyright (c) 1997-2010 Roman Novgorodov        }
{       v9.27                                           }
{       last update: 05 Nov 2010                        }
{                                                       }
{       e-mail:noro@deepsoftware.com                    }
{       DeepSoftware                                    }
{       http://www.deepsoftware.com/                    }
{                                                       }
{*******************************************************}
{$I nrcommlib.inc}
unit nrusb_usb_api;
interface
uses windows, nrusbw32;

Type

  TnrCustomUsbApi = class
  public
    function Open(nameSymbolic:string): THandle; virtual; abstract;
    procedure Close; virtual; abstract;
    function Write(idPipe:integer; data: pointer; len: integer; ovl:POVERLAPPED ):integer; virtual; abstract;
    function Read(idPipe:integer; data: pointer; len: integer; ovl:POVERLAPPED ):integer; virtual; abstract;
    function IsValid:boolean; virtual; abstract;
    function ResetPipe(idPipe:integer):boolean;  virtual; abstract;
    function AbortPipe(idPipe:integer):boolean;  virtual; abstract;
    function FlushPipe(idPipe:integer):boolean;  virtual; abstract;    
    function ControlTransfer( request: TnrUsbRequest;
    {SetupPacket : WINUSB_SETUP_PACKET;
                            Buffer : Pointer;
                            BufferLength:dword;}
                            var LengthTransferred : dword;
                            ovl:POVERLAPPED): boolean; virtual; abstract;
    function GetOverlappedResult(ovl:POVERLAPPED; var szRead:dword; timeout: dword):boolean; virtual; abstract;
    procedure PreparePipe(const idPipe:integer; const timeout:integer; const TransferType:TnrUsbTransferType); virtual; abstract;
  end;

implementation

end.
