C# Class ScpControl.ScpDevice

Low-level representation of an Scp-compatible Usb device.
Exibir arquivo Open project: nefarius/ScpToolkit Class Usage Examples

Protected Properties

Property Type Description
BulkIn byte
BulkOut byte
FileHandle IntPtr
IntIn byte
IntOut byte
Log ILog

Public Methods

Method Description
Close ( ) : bool
GetHardwareId ( string devicePath, short &vendorId, short &productId ) : void
Open ( int instance ) : bool
Open ( string devicePath ) : bool
RegisterNotify ( IntPtr form, Guid Class, IntPtr &handle, bool window = true ) : bool
Start ( ) : bool
Stop ( ) : bool
UnregisterNotify ( IntPtr handle ) : bool

Protected Methods

Method Description
FindDevice ( Guid target, string &path, int instance ) : bool
GetDeviceHandle ( string path ) : bool
GetDeviceInstance ( string &instance ) : bool
GetHardwareId ( string devicePath ) : void
InitializeDevice ( ) : bool
IsBitSet ( byte value, int offset ) : bool
ReadBulkPipe ( byte buffer, int length, int &transfered ) : bool
ReadIntPipe ( byte buffer, int length, int &transfered ) : bool
RestartDevice ( string instanceId ) : bool
ScpDevice ( ) : System
ScpDevice ( Guid Class ) : System
SendTransfer ( UsbHidRequestType requestType, UsbHidRequest request, ushort value, byte buffer, int &transfered ) : bool
SendTransfer ( byte requestType, byte request, ushort value, byte buffer, int &transfered ) : bool
ToValue ( UsbHidClassDescriptorType type, byte index = 0x00 ) : ushort
ToValue ( UsbHidReportRequestType type ) : ushort
ToValue ( UsbHidReportRequestType type, UsbHidReportRequestId id ) : ushort
UsbEndpointDirectionIn ( int addr ) : bool
UsbEndpointDirectionOut ( int addr ) : bool
WriteBulkPipe ( byte buffer, int length, int &transfered ) : bool
WriteIntPipe ( byte buffer, int length, int &transfered ) : bool

Method Details

Close() public method

public Close ( ) : bool
return bool

FindDevice() protected static method

protected static FindDevice ( Guid target, string &path, int instance ) : bool
target Guid
path string
instance int
return bool

GetDeviceHandle() protected method

protected GetDeviceHandle ( string path ) : bool
path string
return bool

GetDeviceInstance() protected method

protected GetDeviceInstance ( string &instance ) : bool
instance string
return bool

GetHardwareId() protected method

protected GetHardwareId ( string devicePath ) : void
devicePath string
return void

GetHardwareId() public static method

public static GetHardwareId ( string devicePath, short &vendorId, short &productId ) : void
devicePath string
vendorId short
productId short
return void

InitializeDevice() protected method

protected InitializeDevice ( ) : bool
return bool

IsBitSet() protected method

protected IsBitSet ( byte value, int offset ) : bool
value byte
offset int
return bool

Open() public method

public Open ( int instance ) : bool
instance int
return bool

Open() public method

public Open ( string devicePath ) : bool
devicePath string
return bool

ReadBulkPipe() protected method

protected ReadBulkPipe ( byte buffer, int length, int &transfered ) : bool
buffer byte
length int
transfered int
return bool

ReadIntPipe() protected method

protected ReadIntPipe ( byte buffer, int length, int &transfered ) : bool
buffer byte
length int
transfered int
return bool

RegisterNotify() public static method

public static RegisterNotify ( IntPtr form, Guid Class, IntPtr &handle, bool window = true ) : bool
form IntPtr
Class Guid
handle IntPtr
window bool
return bool

RestartDevice() protected method

protected RestartDevice ( string instanceId ) : bool
instanceId string
return bool

ScpDevice() protected method

protected ScpDevice ( ) : System
return System

ScpDevice() protected method

protected ScpDevice ( Guid Class ) : System
Class Guid
return System

SendTransfer() protected method

protected SendTransfer ( UsbHidRequestType requestType, UsbHidRequest request, ushort value, byte buffer, int &transfered ) : bool
requestType UsbHidRequestType
request UsbHidRequest
value ushort
buffer byte
transfered int
return bool

SendTransfer() protected method

protected SendTransfer ( byte requestType, byte request, ushort value, byte buffer, int &transfered ) : bool
requestType byte
request byte
value ushort
buffer byte
transfered int
return bool

Start() public method

public Start ( ) : bool
return bool

Stop() public method

public Stop ( ) : bool
return bool

ToValue() protected static method

protected static ToValue ( UsbHidClassDescriptorType type, byte index = 0x00 ) : ushort
type UsbHidClassDescriptorType
index byte
return ushort

ToValue() protected static method

protected static ToValue ( UsbHidReportRequestType type ) : ushort
type UsbHidReportRequestType
return ushort

ToValue() protected static method

protected static ToValue ( UsbHidReportRequestType type, UsbHidReportRequestId id ) : ushort
type UsbHidReportRequestType
id UsbHidReportRequestId
return ushort

UnregisterNotify() public static method

public static UnregisterNotify ( IntPtr handle ) : bool
handle IntPtr
return bool

UsbEndpointDirectionIn() protected method

protected UsbEndpointDirectionIn ( int addr ) : bool
addr int
return bool

UsbEndpointDirectionOut() protected method

protected UsbEndpointDirectionOut ( int addr ) : bool
addr int
return bool

WriteBulkPipe() protected method

protected WriteBulkPipe ( byte buffer, int length, int &transfered ) : bool
buffer byte
length int
transfered int
return bool

WriteIntPipe() protected method

protected WriteIntPipe ( byte buffer, int length, int &transfered ) : bool
buffer byte
length int
transfered int
return bool

Property Details

BulkIn protected_oe property

protected byte BulkIn
return byte

BulkOut protected_oe property

protected byte BulkOut
return byte

FileHandle protected_oe property

protected IntPtr FileHandle
return IntPtr

IntIn protected_oe property

protected byte IntIn
return byte

IntOut protected_oe property

protected byte IntOut
return byte

Log protected_oe static_oe property

protected static ILog Log
return ILog