Skip to content

Commit

Permalink
feat: Add StopAllDevicesAsync method
Browse files Browse the repository at this point in the history
wtf how did this get removed
  • Loading branch information
qdot committed Jun 25, 2023
1 parent fb74af5 commit 99a23fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Buttplug/Client/ButtplugClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ public async Task StopScanningAsync(CancellationToken token = default)
await _handler.SendMessageExpectOk(new StopScanning(), token).ConfigureAwait(false);
}


/// <summary>
/// Instructs the server to send stop command to all connected devices.
/// </summary>
/// <param name="token">Cancellation token, for cancelling action externally if it is not yet finished.</param>
/// <returns>
/// Void on success, throws <see cref="ButtplugClientException" /> otherwise.
/// </returns>
// ReSharper disable once UnusedMember.Global
public async Task StopAllDevicesAsync(CancellationToken token = default)
{
await _handler.SendMessageExpectOk(new StopAllDevices(), token).ConfigureAwait(false);
}

private void ConnectorErrorHandler(object sender, ButtplugExceptionEventArgs exception)
{
ErrorReceived?.Invoke(this, exception);
Expand Down

0 comments on commit 99a23fd

Please sign in to comment.