readValue method

Future<ByteData> readValue()

Will read the value of the descriptor. The value read will be returned and also set as the value property.

  • May throw SecurityError if the descriptor is blocked form reading using a blocklist.

  • May throw NetworkError if the GATT server is not connected.

  • May throw InvalidStateError if descriptor is null

See:

Implementation

Future<ByteData> readValue() async {
  final promise = _JSUtil.callMethod(_jsObject, "readValue", []);
  final result = await _JSUtil.promiseToFuture(promise);
  final data = WebBluetoothConverters.convertJSDataViewToByteData(result);
  return data;
}