共用方式為


GpioController.WaitForEventAsync 方法

定義

多載

WaitForEventAsync(Int32, PinEventTypes, CancellationToken)

非同步呼叫,直到收到 eventType 類型的事件或要求取消為止。

WaitForEventAsync(Int32, PinEventTypes, TimeSpan)

非同步呼叫以等候,直到收到 eventType 類型的事件或一段時間已過期為止。

WaitForEventAsync(Int32, PinEventTypes, CancellationToken)

非同步呼叫,直到收到 eventType 類型的事件或要求取消為止。

public System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult> WaitForEventAsync (int pinNumber, System.Device.Gpio.PinEventTypes eventTypes, System.Threading.CancellationToken token);
public virtual System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult> WaitForEventAsync (int pinNumber, System.Device.Gpio.PinEventTypes eventTypes, System.Threading.CancellationToken token);
member this.WaitForEventAsync : int * System.Device.Gpio.PinEventTypes * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult>
abstract member WaitForEventAsync : int * System.Device.Gpio.PinEventTypes * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult>
override this.WaitForEventAsync : int * System.Device.Gpio.PinEventTypes * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult>
Public Function WaitForEventAsync (pinNumber As Integer, eventTypes As PinEventTypes, token As CancellationToken) As ValueTask(Of WaitForEventResult)
Public Overridable Function WaitForEventAsync (pinNumber As Integer, eventTypes As PinEventTypes, token As CancellationToken) As ValueTask(Of WaitForEventResult)

參數

pinNumber
Int32

控制器編號配置中的針腳編號。

eventTypes
PinEventTypes

要等候的事件種類。

token
CancellationToken

作業何時應該停止等候事件的解除標記。

傳回

表示取得結構之作業的工作,其中包含等候作業的結果

適用於

WaitForEventAsync(Int32, PinEventTypes, TimeSpan)

非同步呼叫以等候,直到收到 eventType 類型的事件或一段時間已過期為止。

public System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult> WaitForEventAsync (int pinNumber, System.Device.Gpio.PinEventTypes eventTypes, TimeSpan timeout);
member this.WaitForEventAsync : int * System.Device.Gpio.PinEventTypes * TimeSpan -> System.Threading.Tasks.ValueTask<System.Device.Gpio.WaitForEventResult>
Public Function WaitForEventAsync (pinNumber As Integer, eventTypes As PinEventTypes, timeout As TimeSpan) As ValueTask(Of WaitForEventResult)

參數

pinNumber
Int32

控制器編號配置中的針腳編號。

eventTypes
PinEventTypes

要等候的事件種類。

timeout
TimeSpan

等候事件的時間。

傳回

工作,表示取得包含等候作業結果的結構作業。

適用於