sendCommand<T> method

Future<T?> sendCommand<T>(
  1. BleCommandTx<T> commandTx, {
  2. int? commandId,
})

Implementation

Future<T?> sendCommand<T>(BleCommandTx<T> commandTx, {int? commandId}) async {
  commandId ??= getNextCommandId();
  final envelope = commandTx.getCommand(commandId);
  return _awaitReply(
    commandTx.parser,
    () => _sendBleCommand(envelope),
    timeout: commandTx.timeout,
    commandId: envelope.commandId,
  );
}