Method CommandAsync
CommandAsync(HarpMessage, CancellationToken)
Sends a command to the Harp device and awaits the response as an asynchronous operation.
public Task<HarpMessage> CommandAsync(HarpMessage command, CancellationToken cancellationToken = default)
Parameters
command
HarpMessageThe HarpMessage specifying the command to send.
cancellationToken
CancellationTokenA CancellationToken which can be used to cancel the operation.
Returns
- Task<HarpMessage>
The task object representing the asynchronous operation. The Result property contains the message representing the response of the device to the asynchronous command.