sendCommands method

Future<void> sendCommands(
  1. List<AtemCommand> commands, {
  2. bool reliable = true,
})

Sends multiple commands in a single packet.

Implementation

Future<void> sendCommands(List<AtemCommand> commands,
    {bool reliable = true}) async {
  if (!_connected) throw StateError('Not connected');

  final builder = BytesBuilder();
  for (final cmd in commands) {
    builder.add(cmd.toBytes());
  }

  if (builder.length > 1300) {
    throw ArgumentError('Command packet too large: ${builder.length} bytes');
  }

  final packet = _createDataPacket(builder.toBytes(), reliable: reliable);
  _sendPacket(packet);
}