read method

  1. @override
Future<List<Uint8>> read(
  1. String deviceId,
  2. String service,
  3. String characteristic,
  4. int timeout,
)
override

Implementation

@override
Future<List<Uint8>> read(
    String deviceId,
    String service,
    String characteristic,
    int timeout
  ) async {
    final result = await _methodChannel.invokeMethod<Map<dynamic, dynamic>?>('read', {
      'deviceId': deviceId,
      'service': service,
      'characteristic': characteristic,
      'timeout': timeout,
    });
    if (result == null
      || result["value"] == null
    ) {
      throw PlatformException(code: "read(): error retrieving value");
    }
    return result["value"] as List<Uint8>;
}