reconfigureInput method

void reconfigureInput({
  1. Bias bias = Bias.unknown,
  2. ActiveState activeState = ActiveState.high,
})

Reconfigures the line as input with the given configuration.

If ProxyGpiod.supportsBias is false, bias must be null, otherwise a UnsupportedError will be thrown.

This will throw a UnsupportedError if ProxyGpiod.supportsLineReconfiguration is false.

You can't specify triggers here because of platform limitations.

Implementation

void reconfigureInput(
    {Bias bias = Bias.unknown, ActiveState activeState = ActiveState.high}) {
  ArgumentError.checkNotNull(activeState, "activeState");
  _checkSupportsBiasValue(bias);
  _checkSupportsLineReconfiguration();

  // we only change the info, not the ownership
 // return _synchronizedWrite(() {
    _info = null;
    _value = null;

//      if (!_requested) {
//        throw StateError(
//            "Can't reconfigured line because it is not requested.");
//      }

    _ProxyGpiodPlatformSide.reconfigureLine(
        lineHandle: _lineHandle,
        direction: LineDirection.input,
        bias: bias,
        activeState: activeState);

    _info = _ProxyGpiodPlatformSide.getLineInfo(_lineHandle);
  //});
}