Main MRPT website > C++ reference for MRPT 1.9.9
xsens/xswinusb.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef XSWINUSB
10 #define XSWINUSB
11 
12 #include <windows.h>
13 #include <winusb.h>
14 
15 struct XsLibraryLoader;
16 
17 typedef BOOL __stdcall WinUSB_Initialize(
18  HANDLE DeviceHandle, WINUSB_INTERFACE_HANDLE* InterfaceHandle);
19 typedef BOOL __stdcall WinUSB_Free(WINUSB_INTERFACE_HANDLE InterfaceHandle);
21  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AssociatedInterfaceIndex,
22  WINUSB_INTERFACE_HANDLE* AssociatedInterfaceHandle);
23 typedef BOOL __stdcall WinUSB_GetDescriptor(
24  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR DescriptorType, UCHAR Index,
25  USHORT LanguageID, PUCHAR Buffer, ULONG BufferLength,
26  PULONG LengthTransferred);
28  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingIndex,
29  PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor);
31  WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG InformationType,
32  PULONG BufferLength, PVOID Buffer);
34  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber);
36  WINUSB_INTERFACE_HANDLE InterfaceHandle, PUCHAR AltSettingNumber);
37 typedef BOOL __stdcall WinUSB_QueryPipe(
38  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber,
39  UCHAR PipeIndex, PWINUSB_PIPE_INFORMATION PipeInformation);
40 typedef BOOL __stdcall WinUSB_SetPipePolicy(
41  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType,
42  ULONG ValueLength, PVOID Value);
43 typedef BOOL __stdcall WinUSB_GetPipePolicy(
44  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType,
45  PULONG ValueLength, PVOID Value);
46 typedef BOOL __stdcall WinUSB_ReadPipe(
47  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer,
48  ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped);
49 typedef BOOL __stdcall WinUSB_WritePipe(
50  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer,
51  ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped);
52 typedef BOOL __stdcall WinUSB_ControlTransfer(
53  WINUSB_INTERFACE_HANDLE InterfaceHandle, WINUSB_SETUP_PACKET SetupPacket,
54  PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred,
55  LPOVERLAPPED Overlapped);
56 typedef BOOL __stdcall WinUSB_ResetPipe(
57  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
58 typedef BOOL __stdcall WinUSB_AbortPipe(
59  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
60 typedef BOOL __stdcall WinUSB_FlushPipe(
61  WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID);
62 typedef BOOL __stdcall WinUSB_SetPowerPolicy(
63  WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType,
64  ULONG ValueLength, PVOID Value);
65 typedef BOOL __stdcall WinUSB_GetPowerPolicy(
66  WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType,
67  PULONG ValueLength, PVOID Value);
68 typedef BOOL __stdcall WinUSB_GetOverlappedResult(
69  WINUSB_INTERFACE_HANDLE InterfaceHandle, LPOVERLAPPED Overlapped,
70  LPDWORD lpNumberOfBytesTransferred, BOOL bWait);
71 
72 class XsWinUsb
73 {
74  public:
75  XsWinUsb(void);
76  ~XsWinUsb(void);
77 
98 
99  private:
100  typedef struct _WINUSB_API
101  {
122  } WINUSB_API;
123 
126 
127  void initLibrary();
128 };
129 
130 #endif // file guard
BOOL __stdcall WinUSB_ResetPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
BOOL __stdcall WinUSB_GetPipePolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, PULONG ValueLength, PVOID Value)
BOOL __stdcall WinUSB_GetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE InterfaceHandle, PUCHAR AltSettingNumber)
WinUSB_SetPipePolicy * SetPipePolicy
WinUSB_Free Free
Frees a WinUsb interface handle.
WinUSB_AbortPipe AbortPipe
Aborts all of the pending transfers for a pipe.
BOOL __stdcall WinUSB_GetAssociatedInterface(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AssociatedInterfaceIndex, WINUSB_INTERFACE_HANDLE *AssociatedInterfaceHandle)
WinUSB_GetPipePolicy GetPipePolicy
Gets the policy for a specific pipe (endpoint).
WINUSB_API m_winUsb
WinUSB_GetAssociatedInterface * GetAssociatedInterface
BOOL __stdcall WinUSB_GetOverlappedResult(WINUSB_INTERFACE_HANDLE InterfaceHandle, LPOVERLAPPED Overlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait)
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
BOOL __stdcall WinUSB_Initialize(HANDLE DeviceHandle, WINUSB_INTERFACE_HANDLE *InterfaceHandle)
WinUSB_GetPowerPolicy GetPowerPolicy
Gets the power policy for a device.
WinUSB_GetDescriptor * GetDescriptor
int BOOL
Definition: xstypedefs.h:76
struct XsWinUsb::_WINUSB_API WINUSB_API
WinUSB_GetPowerPolicy * GetPowerPolicy
XsWinUsb(void)
Definition: xswinusb.cpp:17
BOOL __stdcall WinUSB_GetDescriptor(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR DescriptorType, UCHAR Index, USHORT LanguageID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred)
WinUSB_SetCurrentAlternateSetting * SetCurrentAlternateSetting
BOOL __stdcall WinUSB_ReadPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
BOOL __stdcall WinUSB_SetPowerPolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, ULONG ValueLength, PVOID Value)
WinUSB_ReadPipe ReadPipe
Reads data from the specified pipe.
BOOL __stdcall WinUSB_FlushPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
BOOL __stdcall WinUSB_ControlTransfer(WINUSB_INTERFACE_HANDLE InterfaceHandle, WINUSB_SETUP_PACKET SetupPacket, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
BOOL __stdcall WinUSB_QueryInterfaceSettings(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingIndex, PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor)
WinUSB_Initialize Initialize
Creates/opens a WinUsb interface handle from the device list.
The Xsens dynamic library loader base class.
WinUSB_ResetPipe ResetPipe
Resets the data toggle and clears the stall condition on a pipe.
Class for dynamic loading of winusb.
WinUSB_AbortPipe * AbortPipe
WinUSB_GetCurrentAlternateSetting * GetCurrentAlternateSetting
~XsWinUsb(void)
Definition: xswinusb.cpp:23
BOOL __stdcall WinUSB_GetPowerPolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG PolicyType, PULONG ValueLength, PVOID Value)
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:24
BOOL __stdcall WinUSB_SetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber)
WinUSB_GetDescriptor GetDescriptor
Gets the requested descriptor. This is a synchronous operation.
BOOL __stdcall WinUSB_AbortPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID)
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...
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.
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_QueryPipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR AltSettingNumber, UCHAR PipeIndex, PWINUSB_PIPE_INFORMATION PipeInformation)
WinUSB_QueryDeviceInformation * QueryDeviceInformation
WinUSB_FlushPipe * FlushPipe
BOOL __stdcall WinUSB_SetPipePolicy(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, ULONG PolicyType, ULONG ValueLength, PVOID Value)
WinUSB_ControlTransfer * ControlTransfer
WinUSB_GetPipePolicy * GetPipePolicy
WinUSB_SetPowerPolicy * SetPowerPolicy
WinUSB_WritePipe WritePipe
Writes data to a pipe.
BOOL __stdcall WinUSB_Free(WINUSB_INTERFACE_HANDLE InterfaceHandle)
WinUSB_ControlTransfer ControlTransfer
Transmits control data over a default control endpoint. A ControlTransfer is never cached...
BOOL __stdcall WinUSB_QueryDeviceInformation(WINUSB_INTERFACE_HANDLE InterfaceHandle, ULONG InformationType, PULONG BufferLength, PVOID Buffer)
WinUSB_GetOverlappedResult * GetOverlappedResult
BOOL __stdcall WinUSB_WritePipe(WINUSB_INTERFACE_HANDLE InterfaceHandle, UCHAR PipeID, PUCHAR Buffer, ULONG BufferLength, PULONG LengthTransferred, LPOVERLAPPED Overlapped)
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.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019