C# Class DS4Windows.ScpDevice

Show file Open project: ROFISH/FC30XInput Class Usage Examples

Protected Properties

Property Type Description
m_BulkIn Byte
m_BulkOut Byte
m_Class Guid
m_FileHandle SafeFileHandle
m_IntIn Byte
m_IntOut Byte
m_IsActive Boolean
m_Path String
m_WinUsbHandle IntPtr

Public Methods

Method Description
Close ( ) : Boolean
Open ( Int32 Instance ) : Boolean
Open ( String DevicePath ) : Boolean
ReadBulkPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
ReadIntPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
RegisterNotify ( IntPtr Form, Guid Class, IntPtr &Handle, Boolean Window = true ) : Boolean
ScpDevice ( ) : System
ScpDevice ( IContainer container ) : System
ScpDevice ( String Class ) : System
SendTransfer ( Byte RequestType, Byte Request, UInt16 Value, Byte Buffer, Int32 &Transfered ) : Boolean
Start ( ) : Boolean
Stop ( ) : Boolean
UnregisterNotify ( IntPtr Handle ) : Boolean
WriteBulkPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
WriteIntPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Find ( Guid Target, String &Path, Int32 Instance ) : Boolean
GetDeviceHandle ( String Path ) : Boolean
GetDeviceInstance ( String &Instance ) : Boolean
InitializeDevice ( ) : Boolean
RestartDevice ( String InstanceId ) : Boolean
UsbEndpointDirectionIn ( Int32 addr ) : Boolean
UsbEndpointDirectionOut ( Int32 addr ) : Boolean

Private Methods

Method Description
CM_Get_Device_ID ( Int32 dnDevInst, IntPtr Buffer, Int32 BufferLen, Int32 ulFlags ) : Int32
CreateFile ( String lpFileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes, UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, UInt32 hTemplateFile ) : SafeFileHandle
DeviceIoControl ( SafeFileHandle DeviceHandle, Int32 IoControlCode, Byte InBuffer, Int32 InBufferSize, Byte OutBuffer, Int32 OutBufferSize, Int32 &BytesReturned, IntPtr Overlapped ) : Boolean
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

RegisterDeviceNotification ( IntPtr hRecipient, IntPtr NotificationFilter, Int32 Flags ) : IntPtr
RegisterServiceCtrlHandlerEx ( String ServiceName, ServiceControlHandlerEx Callback, IntPtr Context ) : IntPtr
SetupDiChangeState ( IntPtr DeviceInfoSet, SP_DEVICE_INTERFACE_DATA &DeviceInterfaceData ) : Boolean
SetupDiCreateDeviceInfoList ( System &ClassGuid, Int32 hwndParent ) : Int32
SetupDiDestroyDeviceInfoList ( IntPtr DeviceInfoSet ) : Int32
SetupDiEnumDeviceInterfaces ( IntPtr DeviceInfoSet, IntPtr DeviceInfoData, System &InterfaceClassGuid, Int32 MemberIndex, SP_DEVICE_INTERFACE_DATA &DeviceInterfaceData ) : Boolean
SetupDiGetClassDevs ( System &ClassGuid, IntPtr Enumerator, IntPtr hwndParent, Int32 Flags ) : IntPtr
SetupDiGetDeviceInterfaceDetail ( IntPtr DeviceInfoSet, SP_DEVICE_INTERFACE_DATA &DeviceInterfaceData, IntPtr DeviceInterfaceDetailData, Int32 DeviceInterfaceDetailDataSize, Int32 &RequiredSize, IntPtr DeviceInfoData ) : Boolean
SetupDiGetDeviceInterfaceDetail ( IntPtr DeviceInfoSet, SP_DEVICE_INTERFACE_DATA &DeviceInterfaceData, IntPtr DeviceInterfaceDetailData, Int32 DeviceInterfaceDetailDataSize, Int32 &RequiredSize, SP_DEVICE_INTERFACE_DATA &DeviceInfoData ) : Boolean
SetupDiOpenDeviceInfo ( IntPtr DeviceInfoSet, String DeviceInstanceId, IntPtr hwndParent, Int32 Flags, SP_DEVICE_INTERFACE_DATA &DeviceInfoData ) : Boolean
SetupDiSetClassInstallParams ( IntPtr DeviceInfoSet, SP_DEVICE_INTERFACE_DATA &DeviceInterfaceData, SP_PROPCHANGE_PARAMS &ClassInstallParams, Int32 ClassInstallParamsSize ) : Boolean
UnregisterDeviceNotification ( IntPtr Handle ) : Boolean
WinUsb_AbortPipe ( IntPtr InterfaceHandle, Byte PipeID ) : Boolean
WinUsb_ControlTransfer ( IntPtr InterfaceHandle, WINUSB_SETUP_PACKET SetupPacket, Byte Buffer, Int32 BufferLength, Int32 &LengthTransferred, IntPtr Overlapped ) : Boolean
WinUsb_FlushPipe ( IntPtr InterfaceHandle, Byte PipeID ) : Boolean
WinUsb_Free ( IntPtr InterfaceHandle ) : Boolean
WinUsb_Initialize ( SafeFileHandle DeviceHandle, IntPtr &InterfaceHandle ) : Boolean
WinUsb_QueryInterfaceSettings ( IntPtr InterfaceHandle, Byte AlternateInterfaceNumber, USB_INTERFACE_DESCRIPTOR &UsbAltInterfaceDescriptor ) : Boolean
WinUsb_QueryPipe ( IntPtr InterfaceHandle, Byte AlternateInterfaceNumber, Byte PipeIndex, WINUSB_PIPE_INFORMATION &PipeInformation ) : Boolean
WinUsb_ReadPipe ( IntPtr InterfaceHandle, Byte PipeID, Byte Buffer, Int32 BufferLength, Int32 &LengthTransferred, IntPtr Overlapped ) : Boolean
WinUsb_WritePipe ( IntPtr InterfaceHandle, Byte PipeID, Byte Buffer, Int32 BufferLength, Int32 &LengthTransferred, IntPtr Overlapped ) : Boolean

Method Details

Close() public method

public Close ( ) : Boolean
return Boolean

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

Find() protected method

protected Find ( Guid Target, String &Path, Int32 Instance ) : Boolean
Target Guid
Path String
Instance Int32
return Boolean

GetDeviceHandle() protected method

protected GetDeviceHandle ( String Path ) : Boolean
Path String
return Boolean

GetDeviceInstance() protected method

protected GetDeviceInstance ( String &Instance ) : Boolean
Instance String
return Boolean

InitializeDevice() protected method

protected InitializeDevice ( ) : Boolean
return Boolean

Open() public method

public Open ( Int32 Instance ) : Boolean
Instance Int32
return Boolean

Open() public method

public Open ( String DevicePath ) : Boolean
DevicePath String
return Boolean

ReadBulkPipe() public method

public ReadBulkPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
Buffer Byte
Length Int32
Transfered Int32
return Boolean

ReadIntPipe() public method

public ReadIntPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
Buffer Byte
Length Int32
Transfered Int32
return Boolean

RegisterNotify() public static method

public static RegisterNotify ( IntPtr Form, Guid Class, IntPtr &Handle, Boolean Window = true ) : Boolean
Form IntPtr
Class Guid
Handle IntPtr
Window Boolean
return Boolean

RestartDevice() protected method

protected RestartDevice ( String InstanceId ) : Boolean
InstanceId String
return Boolean

ScpDevice() public method

public ScpDevice ( ) : System
return System

ScpDevice() public method

public ScpDevice ( IContainer container ) : System
container IContainer
return System

ScpDevice() public method

public ScpDevice ( String Class ) : System
Class String
return System

SendTransfer() public method

public SendTransfer ( Byte RequestType, Byte Request, UInt16 Value, Byte Buffer, Int32 &Transfered ) : Boolean
RequestType Byte
Request Byte
Value UInt16
Buffer Byte
Transfered Int32
return Boolean

Start() public method

public Start ( ) : Boolean
return Boolean

Stop() public method

public Stop ( ) : Boolean
return Boolean

UnregisterNotify() public static method

public static UnregisterNotify ( IntPtr Handle ) : Boolean
Handle IntPtr
return Boolean

UsbEndpointDirectionIn() protected method

protected UsbEndpointDirectionIn ( Int32 addr ) : Boolean
addr Int32
return Boolean

UsbEndpointDirectionOut() protected method

protected UsbEndpointDirectionOut ( Int32 addr ) : Boolean
addr Int32
return Boolean

WriteBulkPipe() public method

public WriteBulkPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
Buffer Byte
Length Int32
Transfered Int32
return Boolean

WriteIntPipe() public method

public WriteIntPipe ( Byte Buffer, Int32 Length, Int32 &Transfered ) : Boolean
Buffer Byte
Length Int32
Transfered Int32
return Boolean

Property Details

m_BulkIn protected property

protected Byte m_BulkIn
return Byte

m_BulkOut protected property

protected Byte m_BulkOut
return Byte

m_Class protected property

protected Guid m_Class
return Guid

m_FileHandle protected property

protected SafeFileHandle m_FileHandle
return SafeFileHandle

m_IntIn protected property

protected Byte m_IntIn
return Byte

m_IntOut protected property

protected Byte m_IntOut
return Byte

m_IsActive protected property

protected Boolean m_IsActive
return Boolean

m_Path protected property

protected String m_Path
return String

m_WinUsbHandle protected property

protected IntPtr m_WinUsbHandle
return IntPtr