Main MRPT website > C++ reference for MRPT 1.5.9
xswinusb.h
Go to the documentation of this file.
1 #ifndef XSWINUSB
2 #define XSWINUSB
3 
4 #include <windows.h>
5 #include <winusb.h>
6 
7 struct XsLibraryLoader;
8 
9 typedef BOOL __stdcall WinUSB_Initialize (HANDLE DeviceHandle, WINUSB_INTERFACE_HANDLE* InterfaceHandle);
10 typedef BOOL __stdcall WinUSB_Free (WINUSB_INTERFACE_HANDLE InterfaceHandle);
11 typedef BOOL __stdcall WinUSB_GetAssociatedInterface (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AssociatedInterfaceIndex, WINUSB_INTERFACE_HANDLE* AssociatedInterfaceHandle);
12 typedef BOOL __stdcall WinUSB_GetDescriptor (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR DescriptorType, UCHAR Index, USHORT LanguageID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred);
13 typedef BOOL __stdcall WinUSB_QueryInterfaceSettings (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingIndex, PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor);
14 typedef BOOL __stdcall WinUSB_QueryDeviceInformation (WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG InformationType, PULONG BufferLength, PVOID Buffer);
15 typedef BOOL __stdcall WinUSB_SetCurrentAlternateSetting (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber);
16 typedef BOOL __stdcall WinUSB_GetCurrentAlternateSetting (WINUSB_INTERFACE_HANDLE InterfaceHandle, PUCHAR AltSettingNumber);
17 typedef BOOL __stdcall WinUSB_QueryPipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber, UCHAR PipeIndex, PWINUSB_PIPE_INFORMATION PipeInformation);
18 typedef BOOL __stdcall WinUSB_SetPipePolicy (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, ULONG ValueLength, PVOID Value);
19 typedef BOOL __stdcall WinUSB_GetPipePolicy (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, PULONG ValueLength, PVOID Value);
20 typedef BOOL __stdcall WinUSB_ReadPipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped);
21 typedef BOOL __stdcall WinUSB_WritePipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped);
22 typedef BOOL __stdcall WinUSB_ControlTransfer (WINUSB_INTERFACE_HANDLE InterfaceHandle, WINUSB_SETUP_PACKET SetupPacket, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped);
23 typedef BOOL __stdcall WinUSB_ResetPipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
24 typedef BOOL __stdcall WinUSB_AbortPipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
25 typedef BOOL __stdcall WinUSB_FlushPipe (WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
26 typedef BOOL __stdcall WinUSB_SetPowerPolicy (WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, ULONG ValueLength, PVOID Value);
27 typedef BOOL __stdcall WinUSB_GetPowerPolicy (WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, PULONG ValueLength, PVOID Value);
28 typedef BOOL __stdcall WinUSB_GetOverlappedResult (WINUSB_INTERFACE_HANDLE InterfaceHandle, LPOVERLAPPED Overlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait);
29 
30 class XsWinUsb
31 {
32 public:
33  XsWinUsb(void);
34  ~XsWinUsb(void);
35 
56 
57 private:
58 
59  typedef struct _WINUSB_API
60  {
62  WinUSB_Free (* Free);
81  } WINUSB_API;
82 
85 
86  void initLibrary();
87 };
88 
89 #endif // file guard
90 
WinUSB_SetPipePolicy * SetPipePolicy
BOOL __stdcall WinUSB_ResetPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
Definition: xswinusb.h:23
WinUSB_Free Free
Frees a WinUsb interface handle.
BOOL __stdcall WinUSB_SetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber)
Definition: xswinusb.h:15
WinUSB_AbortPipe AbortPipe
Aborts all of the pending transfers for a pipe.
WinUSB_GetPipePolicy GetPipePolicy
Gets the policy for a specific pipe (endpoint).
WINUSB_API m_winUsb
WinUSB_GetAssociatedInterface * GetAssociatedInterface
BOOL __stdcall WinUSB_GetPipePolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, PULONG ValueLength, PVOID Value)
Definition: xswinusb.h:19
XsLibraryLoader * m_libraryLoader
WinUSB_QueryPipe QueryPipe
Retrieves information about a pipe that is associated with an interface. The QueryPipe function does ...
WinUSB_SetCurrentAlternateSetting SetCurrentAlternateSetting
Sets the alternate setting of an interface. Sets the active bAlternateSetting for the current/default...
WinUSB_Initialize * Initialize
WinUSB_GetPowerPolicy GetPowerPolicy
Gets the power policy for a device.
BOOL __stdcall WinUSB_GetAssociatedInterface(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AssociatedInterfaceIndex, WINUSB_INTERFACE_HANDLE *AssociatedInterfaceHandle)
Definition: xswinusb.h:11
WinUSB_GetDescriptor * GetDescriptor
int BOOL
Definition: xstypedefs.h:62
struct XsWinUsb::_WINUSB_API WINUSB_API
WinUSB_GetPowerPolicy * GetPowerPolicy
XsWinUsb(void)
Definition: xswinusb.cpp:17
BOOL __stdcall WinUSB_WritePipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
Definition: xswinusb.h:21
BOOL __stdcall WinUSB_GetOverlappedResult(WINUSB_INTERFACE_HANDLE InterfaceHandle, LPOVERLAPPED Overlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait)
Definition: xswinusb.h:28
WinUSB_SetCurrentAlternateSetting * SetCurrentAlternateSetting
BOOL __stdcall WinUSB_SetPipePolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, ULONG ValueLength, PVOID Value)
Definition: xswinusb.h:18
WinUSB_ReadPipe ReadPipe
Reads data from the specified pipe.
WinUSB_Initialize Initialize
Creates/opens a WinUsb interface handle from the device list.
BOOL __stdcall WinUSB_Free(WINUSB_INTERFACE_HANDLE InterfaceHandle)
Definition: xswinusb.h:10
The Xsens dynamic library loader base class.
WinUSB_ResetPipe ResetPipe
Resets the data toggle and clears the stall condition on a pipe.
BOOL __stdcall WinUSB_GetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE InterfaceHandle, PUCHAR AltSettingNumber)
Definition: xswinusb.h:16
BOOL __stdcall WinUSB_GetPowerPolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, PULONG ValueLength, PVOID Value)
Definition: xswinusb.h:27
Class for dynamic loading of winusb.
WinUSB_AbortPipe * AbortPipe
WinUSB_GetCurrentAlternateSetting * GetCurrentAlternateSetting
~XsWinUsb(void)
Definition: xswinusb.cpp:23
WinUSB_GetOverlappedResult GetOverlappedResult
Retrieves the results of an overlapped operation on the specified winUSB handle.
WinUSB_FlushPipe FlushPipe
Discards any data that is cached in a pipe.
void initLibrary()
Definition: xswinusb.cpp:28
WinUSB_GetDescriptor GetDescriptor
Gets the requested descriptor. This is a synchronous operation.
WinUSB_QueryPipe * QueryPipe
WinUSB_SetPowerPolicy SetPowerPolicy
Sets the power policy for a device. The following list summarizes the effects of changes to power man...
WinUSB_QueryInterfaceSettings QueryInterfaceSettings
Retrieves the interface descriptor for the specified alternate interface settings for a particular in...
BOOL __stdcall WinUSB_GetDescriptor(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR DescriptorType, UCHAR Index, USHORT LanguageID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred)
Definition: xswinusb.h:12
WinUSB_ResetPipe * ResetPipe
WinUSB_QueryDeviceInformation QueryDeviceInformation
Retrieves information about the physical device that is associated with a WinUSB handle.
WinUSB_WritePipe * WritePipe
WinUSB_GetAssociatedInterface GetAssociatedInterface
Retrieves a handle for an associated interface.
BOOL __stdcall WinUSB_ReadPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
Definition: xswinusb.h:20
WinUSB_SetPipePolicy SetPipePolicy
Sets the policy for a specific pipe associated with an endpoint on the device. This is a synchronous ...
WinUSB_ReadPipe * ReadPipe
WinUSB_QueryInterfaceSettings * QueryInterfaceSettings
BOOL __stdcall WinUSB_Initialize(HANDLE DeviceHandle, WINUSB_INTERFACE_HANDLE *InterfaceHandle)
Definition: xswinusb.h:9
BOOL __stdcall WinUSB_QueryPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber, UCHAR PipeIndex, PWINUSB_PIPE_INFORMATION PipeInformation)
Definition: xswinusb.h:17
BOOL __stdcall WinUSB_SetPowerPolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, ULONG ValueLength, PVOID Value)
Definition: xswinusb.h:26
WinUSB_QueryDeviceInformation * QueryDeviceInformation
WinUSB_FlushPipe * FlushPipe
BOOL __stdcall WinUSB_QueryDeviceInformation(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG InformationType, PULONG BufferLength, PVOID Buffer)
Definition: xswinusb.h:14
WinUSB_ControlTransfer * ControlTransfer
WinUSB_GetPipePolicy * GetPipePolicy
WinUSB_SetPowerPolicy * SetPowerPolicy
BOOL __stdcall WinUSB_ControlTransfer(WINUSB_INTERFACE_HANDLE InterfaceHandle, WINUSB_SETUP_PACKET SetupPacket, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
Definition: xswinusb.h:22
BOOL __stdcall WinUSB_FlushPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
Definition: xswinusb.h:25
WinUSB_WritePipe WritePipe
Writes data to a pipe.
WinUSB_ControlTransfer ControlTransfer
Transmits control data over a default control endpoint. A ControlTransfer is never cached...
BOOL __stdcall WinUSB_QueryInterfaceSettings(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingIndex, PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor)
Definition: xswinusb.h:13
WinUSB_GetOverlappedResult * GetOverlappedResult
BOOL __stdcall WinUSB_AbortPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
Definition: xswinusb.h:24
WinUSB_GetCurrentAlternateSetting GetCurrentAlternateSetting
Gets the current alternate interface setting for an interface. Gets the active bAlternateSetting for ...



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020