linear method

Future<void> linear(
  1. LinearCommand command
)

Implementation

Future<void> linear(LinearCommand command) async {
  if (messageAttributes.linearCmd == null) {
    throw ButtplugClientDeviceException("$name ($displayName) does not support linear commands");
  }
  var linearMsg = LinearCmd();
  linearMsg.deviceIndex = index;
  var subcommandList = <LinearSubcommand>[];
  command.asMap(messageAttributes.linearCmd!.length).forEach((key, value) {
    subcommandList.add(LinearSubcommand(key, value.position, value.duration));
  });
  linearMsg.vectors = subcommandList;
  return await _sendMessageExpectOk(linearMsg);
}