C# Class UsbUirt.Controller

Provides a managed wrapper around the USB-UIRT driver.
Inheritance: IDisposable
ファイルを表示 Open project: fatihboy/Robosapien Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Releases all managed and unmanaged resources held by this object.

Learn ( ) : string

Learns an IR code synchronously using the default code format.

Learn ( CodeFormat codeFormat ) : string

Learns an IR code synchronously.

Learn ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, System.TimeSpan timeout ) : string

Learns an IR code synchronously.

Learn ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, uint forcedFrequency, System.TimeSpan timeout ) : string

Learns an IR code synchronously.

Learn ( System.TimeSpan timeout ) : string

Learns an IR code synchronously using the default code format.

LearnAsync ( ) : void

Learns an IR code asynchronously using the default code format.

LearnAsync ( CodeFormat codeFormat ) : void

Learns an IR code asynchronously.

LearnAsync ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, object userState ) : void

Learns an IR code asynchronously.

LearnAsync ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, uint forcedFrequency, object userState ) : void

Learns an IR code asynchronously.

LearnAsyncCancel ( object userState ) : bool

Cancels a LearnAsync() operation that was passed the specified userState.

LearnAsyncCancel ( ) : void

Cancels a LearnAsync() operation.

Transmit ( string irCode ) : void

Transmits an IR code synchronously using the default code format.

Transmit ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime ) : void

Transmits an IR code synchronously.

TransmitAsync ( string irCode ) : void

Transmits an IR code asynchronously using the default code format.

TransmitAsync ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime ) : void

Transmits an IR code asynchronously.

TransmitAsync ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime, object userState ) : void

Transmits an IR code asynchronously.

Private Methods

Method Description
CheckDisposed ( ) : void
ClearReceiveCallback ( ) : void
Controller ( ) : System
Dispose ( bool disposeManagedResources ) : void
DoLearn ( object state ) : void
DoTransmit ( object state ) : void
GetConfig ( ) : UUIRTConfigBits
GetVersion ( ) : UUINFO
LearnCallbackProc ( uint progress, uint sigQuality, uint carrierFreq, IntPtr userState ) : void
ManagedWrapper_LearnCompleted ( object sender, LearnCompletedEventArgs e ) : void
OpenDriver ( ) : IntPtr
ReceiveCallbackProc ( StringBuilder irEventString, IntPtr userState ) : void
SetConfig ( bool blinkOnReceive, bool blinkOnTransmit, bool generateLegacyCodesOnReceive ) : void
SetReceiveCallback ( ReceiveCallback cb ) : void
TransmitIr ( string irCode, CodeFormat codeFormat, int repeatCount, int inactivityWaitTime, ManualResetEvent evt ) : void
UUIRTClose ( IntPtr hDrvHandle ) : bool
UUIRTGetDrvInfo ( uint &drvVersion ) : bool
UUIRTGetUUIRTConfig ( IntPtr hDrvHandle, uint &uConfig ) : bool
UUIRTGetUUIRTInfo ( IntPtr hDrvHandle, UUINFO &uuInfo ) : bool
UUIRTLearnIR ( IntPtr hDrvHandle, int codeFormat, StringBuilder IRCode, LearnCallback progressProc, IntPtr userData, IntPtr pAbort, uint param1, IntPtr reserved0, IntPtr reserved1 ) : bool
UUIRTOpen ( ) : IntPtr
UUIRTSetReceiveCallback ( IntPtr hDrvHandle, ReceiveCallback receiveProc, IntPtr userData ) : bool
UUIRTSetUUIRTConfig ( IntPtr hDrvHandle, uint uConfig ) : bool
UUIRTTransmitIR ( IntPtr hDrvHandle, string irCode, int codeFormat, int repeatCount, int inactivityWaitTime, IntPtr hEvent, IntPtr reserved0, IntPtr reserved1 ) : bool

Method Details

Dispose() public method

Releases all managed and unmanaged resources held by this object.
public Dispose ( ) : void
return void

Learn() public method

Learns an IR code synchronously using the default code format.
public Learn ( ) : string
return string

Learn() public method

Learns an IR code synchronously.
public Learn ( CodeFormat codeFormat ) : string
codeFormat CodeFormat The format of the IR code to use in learning.
return string

Learn() public method

Learns an IR code synchronously.
public Learn ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, System.TimeSpan timeout ) : string
codeFormat CodeFormat The format of the IR code to use in learning.
learnCodeFormat LearnCodeModifier The modifier used for the code format.
timeout System.TimeSpan The timeout after which to abort learning if it has not completed.
return string

Learn() public method

Learns an IR code synchronously.
public Learn ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, uint forcedFrequency, System.TimeSpan timeout ) : string
codeFormat CodeFormat The format of the IR code to use in learning.
learnCodeFormat LearnCodeModifier The modifier used for the code format.
forcedFrequency uint The frequency to use in learning.
timeout System.TimeSpan The timeout after which to abort learning if it has not completed.
return string

Learn() public method

Learns an IR code synchronously using the default code format.
public Learn ( System.TimeSpan timeout ) : string
timeout System.TimeSpan The timeout after which to abort learning if it has not completed.
return string

LearnAsync() public method

Learns an IR code asynchronously using the default code format.
public LearnAsync ( ) : void
return void

LearnAsync() public method

Learns an IR code asynchronously.
public LearnAsync ( CodeFormat codeFormat ) : void
codeFormat CodeFormat The format of the IR code to use in learning.
return void

LearnAsync() public method

Learns an IR code asynchronously.
public LearnAsync ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, object userState ) : void
codeFormat CodeFormat The format of the IR code to use in learning.
learnCodeFormat LearnCodeModifier The modifier used for the code format.
userState object /// An optional user state object that will be passed to the /// Learning and LearnCompleted events and which can be used when calling LearnAsyncCancel(). ///
return void

LearnAsync() public method

Learns an IR code asynchronously.
public LearnAsync ( CodeFormat codeFormat, LearnCodeModifier learnCodeFormat, uint forcedFrequency, object userState ) : void
codeFormat CodeFormat The format of the IR code to use in learning.
learnCodeFormat LearnCodeModifier The modifier used for the code format.
forcedFrequency uint The frequency to use in learning.
userState object /// An optional user state object that will be passed to the /// Learning and LearnCompleted events and which can be used when calling LearnAsyncCancel(). ///
return void

LearnAsyncCancel() public method

Cancels a LearnAsync() operation that was passed the specified userState.
public LearnAsyncCancel ( object userState ) : bool
userState object The optional userState object passed to LearnAsync().
return bool

LearnAsyncCancel() public method

Cancels a LearnAsync() operation.
public LearnAsyncCancel ( ) : void
return void

Transmit() public method

Transmits an IR code synchronously using the default code format.
public Transmit ( string irCode ) : void
irCode string The IR code to transmit.
return void

Transmit() public method

Transmits an IR code synchronously.
public Transmit ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime ) : void
irCode string The IR code to transmit.
codeFormat CodeFormat The format of the IR code.
repeatCount int /// Indicates how many iterations of the code should be /// sent (in the case of a 2-piece code, the first stream is sent once followed /// by the second stream sent repeatCount times). ///
inactivityWaitTime System.TimeSpan /// Time in milliseconds since the last received /// IR activity to wait before sending an IR code. Normally, pass 0 for this parameter. ///
return void

TransmitAsync() public method

Transmits an IR code asynchronously using the default code format.
public TransmitAsync ( string irCode ) : void
irCode string The IR code to transmit.
return void

TransmitAsync() public method

Transmits an IR code asynchronously.
public TransmitAsync ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime ) : void
irCode string The IR code to transmit.
codeFormat CodeFormat The format of the IR code.
repeatCount int /// Indicates how many iterations of the code should be /// sent (in the case of a 2-piece code, the first stream is sent once followed /// by the second stream sent repeatCount times). ///
inactivityWaitTime System.TimeSpan /// Time in milliseconds since the last received /// IR activity to wait before sending an IR code. Normally, pass 0 for this parameter. ///
return void

TransmitAsync() public method

Transmits an IR code asynchronously.
public TransmitAsync ( string irCode, CodeFormat codeFormat, int repeatCount, System.TimeSpan inactivityWaitTime, object userState ) : void
irCode string The IR code to transmit.
codeFormat CodeFormat The format of the IR code.
repeatCount int /// Indicates how many iterations of the code should be /// sent (in the case of a 2-piece code, the first stream is sent once followed /// by the second stream sent repeatCount times). ///
inactivityWaitTime System.TimeSpan /// Time in milliseconds since the last received /// IR activity to wait before sending an IR code. Normally, pass 0 for this parameter. ///
userState object /// An optional user state object that will be passed to the /// TransmitCompleted event. ///
return void