setDtr method

  1. @override
Future<void> setDtr(
  1. bool active
)
override

Drive the DTR (Data Terminal Ready) modem control line. Default implementation throws — production transports override.

Implementation

@override
Future<void> setDtr(bool active) async {
  if (!isOpen) throw StateError('LibserialportSerialTransport not open');
  _check(
    _bindings.spSetDtr(_port!, active ? SpSignal.high : SpSignal.low),
    'sp_set_dtr',
  );
}