getValue method

bool getValue()

Reads the value of the line (active / inactive)

Throws a StateError if the line is not requested.

If the line is in output mode, the last written value using setValue will be returned synchronously. If setValue was never called, the initialValue given to request or release will be returned.

If direction == LineDirection.input this will obtain a fresh value from the platform side.

Implementation

bool getValue() {
  /*if (_mutex.isWriteLocked) {
    // If it is locked, we need to synchronize the access.
    //return _synchronizedRead(() {
      /*if (_requested == false) {
        throw StateError(
            "Can't get line value because line is not requested.");
      }*/

      if (_info.direction == LineDirection.input) {
        return _FlutterGpiodPlatformSide.getLineValue(_lineHandle);
      } else {
        return _value;
      }
   // });
  } else */{
    /*if (_requested == false) {
      throw StateError("Can't get line value because line is not requested.");
    }*/

    if (_info != null && _info?.direction == LineDirection.output) {
      return _value == null? false : _value as bool;
    } else {
      return //_synchronizedRead(   () =>
          _ProxyGpiodPlatformSide.getLineValue(_lineHandle);
    }
  }
}