GpioController.WaitForEventAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 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
等待事件的时间。
返回
一个任务,表示获取包含等待操作结果的结构的操作。