// // $History: usbdrvd.h $ // //***************** Version 1 ***************** //User: JungoCE Date: 6/04/09 Time: 9:41a //Created in $/USB_DRV/DLL #ifndef _USBDRVD_H_ #define _USBDRVD_H_ #define USBDRVD_EXPORTS #ifdef USBDRVD_EXPORTS #define USBDRVD_API __declspec(dllexport) #else #define USBDRVD_API __declspec(dllimport) #endif //////////////////////////////////////////////////////////////////////////////// ///////////////// Device Functions /////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus extern "C"{ #endif //Returns number of USBDRVD devices attached USBDRVD_API UINT _stdcall USBDRVD_GetDevCount(const GUID *pUSB_GUID); USBDRVD_API HANDLE _stdcall USBDRVD_OpenDevice(UINT DevNum, DWORD dwFlagsAndAttributes, const GUID * pUSB_GUID); USBDRVD_API void _stdcall USBDRVD_CloseDevice(HANDLE hDevice); USBDRVD_API UINT _stdcall USBDRVD_GetStringDescriptor(HANDLE hDevice, USHORT LangID, ULONG Index, ULONG Length, PCHAR pString); USBDRVD_API UINT _stdcall USBDRVD_GetDriverVersion(HANDLE hDevice, ULONG *pMajor, ULONG *pMinor); USBDRVD_API ULONG _stdcall USBDRVD_VendorOrClassRequestOut(HANDLE hDevice, UCHAR Type, // 1=class, 2 = vendor UCHAR Destination, // 0=device, 1=interface, // 2=endpoint, 3=other // see the USB Specification for an explanation of the following UCHAR Request, // request USHORT Value, // value USHORT Index, // index PUCHAR pData, // data buffer ULONG Length); // length of data //Opens Pipe on device DevNum returning handle for pipe operations USBDRVD_API HANDLE _stdcall USBDRVD_PipeOpen(UINT DevNum, UINT Pipe, DWORD dwFlagsAndAttributes, const GUID *pUSB_GUID); //Given hPipe from prior USBDRVD_OpenPipe(), closes the pipe USBDRVD_API void _stdcall USBDRVD_PipeClose(HANDLE hPipe); //Writefile() wrapper with timeout USBDRVD_API BOOL _stdcall USBDRVD_PipeWriteTimeout(HANDLE hPipe, LPVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, DWORD dwTimeout); //ReadFile() wrapper with timeout USBDRVD_API BOOL _stdcall USBDRVD_PipeReadTimeout(HANDLE hPipe, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, DWORD dwTimeout); //Resets hPipe after a stall condition. (not normally needed, but provided) USBDRVD_API BOOL _stdcall USBDRVD_PipeReset(HANDLE hPipe); #ifdef __cplusplus } #endif #endif