SpringCard LibCs.Windows for .NET  18.10.10
A set of utilities for the Windows platform
SpringCard.LibCs.Windows.HID Class Reference

Classes

struct  HIDD_ATTRIBUTES
 
struct  HIDP_CAPS
 

Public Member Functions

static Boolean HidD_FlushQueue (SafeFileHandle HidDeviceObject)
 
static Boolean HidD_FreePreparsedData (IntPtr PreparsedData)
 
static Boolean HidD_GetAttributes (SafeFileHandle HidDeviceObject, ref HIDD_ATTRIBUTES Attributes)
 
static Boolean HidD_GetFeature (SafeFileHandle HidDeviceObject, Byte[] lpReportBuffer, Int32 ReportBufferLength)
 
static Boolean HidD_GetInputReport (SafeFileHandle HidDeviceObject, Byte[] lpReportBuffer, Int32 ReportBufferLength)
 
static void HidD_GetHidGuid (ref System.Guid HidGuid)
 
static Boolean HidD_GetNumInputBuffers (SafeFileHandle HidDeviceObject, ref Int32 NumberBuffers)
 
static Boolean HidD_GetPreparsedData (SafeFileHandle HidDeviceObject, ref IntPtr PreparsedData)
 
static Boolean HidD_SetFeature (SafeFileHandle HidDeviceObject, Byte[] lpReportBuffer, Int32 ReportBufferLength)
 
static Boolean HidD_SetNumInputBuffers (SafeFileHandle HidDeviceObject, Int32 NumberBuffers)
 
static Boolean HidD_SetOutputReport (SafeFileHandle HidDeviceObject, Byte[] lpReportBuffer, Int32 ReportBufferLength)
 
static Int32 HidP_GetCaps (IntPtr PreparsedData, ref HIDP_CAPS Capabilities)
 
static Int32 HidP_GetValueCaps (Int32 ReportType, Byte[] ValueCaps, ref Int32 ValueCapsLength, IntPtr PreparsedData)
 
Boolean FlushQueue (SafeFileHandle hidHandle)
 Remove any Input reports waiting in the buffer. More...
 
Boolean GetFeatureReport (SafeFileHandle hidHandle, ref Byte[] inFeatureReportBuffer)
 reads a Feature report from the device. More...
 
String GetHidUsage (HIDP_CAPS MyCapabilities)
 Creates a 32-bit Usage from the Usage Page and Usage ID. Determines whether the Usage is a system mouse or keyboard. Can be modified to detect other Usages. More...
 
Boolean GetInputReportViaControlTransfer (SafeFileHandle hidHandle, ref Byte[] inputReportBuffer)
 reads an Input report from the device using a control transfer. More...
 
Boolean GetNumberOfInputBuffers (SafeFileHandle hidDeviceObject, ref Int32 numberOfInputBuffers)
 Retrieves the number of Input reports the host can store. More...
 
Boolean SendFeatureReport (SafeFileHandle hidHandle, Byte[] outFeatureReportBuffer)
 writes a Feature report to the device. More...
 
Boolean SendOutputReportViaControlTransfer (SafeFileHandle hidHandle, Byte[] outputReportBuffer)
 Writes an Output report to the device using a control transfer. More...
 
Boolean SetNumberOfInputBuffers (SafeFileHandle hidDeviceObject, Int32 numberBuffers)
 sets the number of input reports the host will store. Requires Windows XP or later. More...
 
Boolean IsWindowsXpOrLater ()
 Find out if the current operating system is Windows XP or later. (Windows XP or later is required for HidD_GetInputReport and HidD_SetInputReport.) More...
 
Boolean IsWindows98Gold ()
 Find out if the current operating system is Windows 98 Gold (original version). Windows 98 Gold does not support the following: Interrupt OUT transfers (WriteFile uses control transfers and Set_Report). HidD_GetNumInputBuffers and HidD_SetNumInputBuffers (Not yet tested on a Windows 98 Gold system.) More...
 

Static Public Member Functions

static HIDP_CAPS GetDeviceCapabilities (SafeFileHandle hidHandle)
 Retrieves a structure with information about a device's capabilities. More...
 
static List< WMI.DeviceInfoEnumDevices ()
 

Public Attributes

const Int16 HidP_Input = 0
 
const Int16 HidP_Output = 1
 
const Int16 HidP_Feature = 2
 
HIDD_ATTRIBUTES DeviceAttributes
 
HIDP_CAPS Capabilities
 

Member Function Documentation

◆ FlushQueue()

Boolean SpringCard.LibCs.Windows.HID.FlushQueue ( SafeFileHandle  hidHandle)

Remove any Input reports waiting in the buffer.

Parameters
hidHandlea handle to a device.
Returns
True on success, False on failure.

◆ GetDeviceCapabilities()

static HIDP_CAPS SpringCard.LibCs.Windows.HID.GetDeviceCapabilities ( SafeFileHandle  hidHandle)
static

Retrieves a structure with information about a device's capabilities.

Parameters
hidHandlea handle to a device.
Returns
An HIDP_CAPS structure.

◆ GetFeatureReport()

Boolean SpringCard.LibCs.Windows.HID.GetFeatureReport ( SafeFileHandle  hidHandle,
ref Byte []  inFeatureReportBuffer 
)

reads a Feature report from the device.

Parameters
hidHandlethe handle for learning about the device and exchanging Feature reports.
myDeviceDetectedtells whether the device is currently attached.
inFeatureReportBuffercontains the requested report.
successread success

◆ GetHidUsage()

String SpringCard.LibCs.Windows.HID.GetHidUsage ( HIDP_CAPS  MyCapabilities)

Creates a 32-bit Usage from the Usage Page and Usage ID. Determines whether the Usage is a system mouse or keyboard. Can be modified to detect other Usages.

Parameters
MyCapabilitiesa HIDP_CAPS structure retrieved with HidP_GetCaps.
Returns
A String describing the Usage.

◆ GetInputReportViaControlTransfer()

Boolean SpringCard.LibCs.Windows.HID.GetInputReportViaControlTransfer ( SafeFileHandle  hidHandle,
ref Byte []  inputReportBuffer 
)

reads an Input report from the device using a control transfer.

Parameters
hidHandlethe handle for learning about the device and exchanging Feature reports.
myDeviceDetectedtells whether the device is currently attached.
inputReportBuffercontains the requested report.
successread success

◆ GetNumberOfInputBuffers()

Boolean SpringCard.LibCs.Windows.HID.GetNumberOfInputBuffers ( SafeFileHandle  hidDeviceObject,
ref Int32  numberOfInputBuffers 
)

Retrieves the number of Input reports the host can store.

Parameters
hidDeviceObjecta handle to a device
numberOfInputBuffersan integer to hold the returned value.
Returns
True on success, False on failure.

◆ IsWindows98Gold()

Boolean SpringCard.LibCs.Windows.HID.IsWindows98Gold ( )

Find out if the current operating system is Windows 98 Gold (original version). Windows 98 Gold does not support the following: Interrupt OUT transfers (WriteFile uses control transfers and Set_Report). HidD_GetNumInputBuffers and HidD_SetNumInputBuffers (Not yet tested on a Windows 98 Gold system.)

◆ IsWindowsXpOrLater()

Boolean SpringCard.LibCs.Windows.HID.IsWindowsXpOrLater ( )

Find out if the current operating system is Windows XP or later. (Windows XP or later is required for HidD_GetInputReport and HidD_SetInputReport.)

◆ SendFeatureReport()

Boolean SpringCard.LibCs.Windows.HID.SendFeatureReport ( SafeFileHandle  hidHandle,
Byte []  outFeatureReportBuffer 
)

writes a Feature report to the device.

Parameters
outFeatureReportBuffercontains the report ID and report data.
hidHandlehandle to the device.
Returns
True on success. False on failure.

◆ SendOutputReportViaControlTransfer()

Boolean SpringCard.LibCs.Windows.HID.SendOutputReportViaControlTransfer ( SafeFileHandle  hidHandle,
Byte []  outputReportBuffer 
)

Writes an Output report to the device using a control transfer.

Parameters
outputReportBuffercontains the report ID and report data.
hidHandlehandle to the device.
Returns
True on success. False on failure.

◆ SetNumberOfInputBuffers()

Boolean SpringCard.LibCs.Windows.HID.SetNumberOfInputBuffers ( SafeFileHandle  hidDeviceObject,
Int32  numberBuffers 
)

sets the number of input reports the host will store. Requires Windows XP or later.

Parameters
hidDeviceObjecta handle to the device.
numberBuffersthe requested number of input reports.
Returns
True on success. False on failure.

The documentation for this class was generated from the following file: