Table of Contents

Method CommandAsync

Namespace
Bonsai.Harp
Assembly
Bonsai.Harp.dll

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 HarpMessage

The HarpMessage specifying the command to send.

cancellationToken CancellationToken

A 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.