C# 클래스 MonoLibUsb.MonoUsbEventHandler

Manages a static Libusb-1.0 MonoUsbSessionHandle and "handle_events" thread for simplified asynchronous IO.

This class contains its own MonoUsbSessionHandle that is initialized with one of the overloaded MonoUsbEventHandler.Init() functions.

This class contains a static thread that execute MonoUsbApi.HandleEventsTimeout. See the Start and Stop methods.

파일 보기 프로젝트 열기: arvydas/BlinkStickDotNet 1 사용 예제들

공개 메소드들

메소드 설명
Exit ( ) : void

Stops the handle events thread and closes the session handle.

Init ( ) : void

Initializes the SessionHandle.

If the session has already been initialized, this method does nothing.

The handle events thread is not started until the Start method is called.

Uses the MonoLibUsb UnixNativeTimeval.Default polling interval for MonoUsbApi.HandleEventsTimeout.

Init ( long tvSec, long tvUsec ) : void

Initializes the SessionHandle and sets a custom polling interval.

Start ( ) : bool

Starts the handle events thread.

If the thread is already running, this method does nothing.

Using a seperate thread which executes MonoUsbApi.HandleEventsTimeout can simplify asynchronous I/O and improve performance in multi-threaded applications which use multiple endpoints.

Stop ( bool bWait ) : void

Stops the handle events thread.

Calling this method when the thread is not running will have no affect.

If the thread is running, this method must be called before the application exits. Failure to do so will cause the application to hang.

비공개 메소드들

메소드 설명
HandleEventFn ( object oHandle ) : void
Init ( UnixNativeTimeval unixNativeTimeval ) : void

메소드 상세

Exit() 공개 정적인 메소드

Stops the handle events thread and closes the session handle.
public static Exit ( ) : void
리턴 void

Init() 공개 정적인 메소드

Initializes the SessionHandle.

If the session has already been initialized, this method does nothing.

The handle events thread is not started until the Start method is called.

Uses the MonoLibUsb UnixNativeTimeval.Default polling interval for MonoUsbApi.HandleEventsTimeout.

public static Init ( ) : void
리턴 void

Init() 공개 정적인 메소드

Initializes the SessionHandle and sets a custom polling interval.
public static Init ( long tvSec, long tvUsec ) : void
tvSec long polling interval seconds
tvUsec long polling interval milliseconds
리턴 void

Start() 공개 정적인 메소드

Starts the handle events thread.

If the thread is already running, this method does nothing.

Using a seperate thread which executes MonoUsbApi.HandleEventsTimeout can simplify asynchronous I/O and improve performance in multi-threaded applications which use multiple endpoints.

public static Start ( ) : bool
리턴 bool

Stop() 공개 정적인 메소드

Stops the handle events thread.

Calling this method when the thread is not running will have no affect.

If the thread is running, this method must be called before the application exits. Failure to do so will cause the application to hang.
public static Stop ( bool bWait ) : void
bWait bool If true, wait for the thread to exit before returning.
리턴 void