writeRawData method

  1. @override
Future<bool> writeRawData(
  1. Uint8List bytes
)
override

Write raw data to the connected device. Must connect to a device first. Throw BTException if failed.

Implementation

@override
Future<bool> writeRawData(Uint8List bytes) async {
  try {
    Map<String, dynamic> args = {"bytes": bytes, "isBLE": _isBLE};
    return await methodChannel.invokeMethod("writeData", args);
  } on PlatformException catch (e) {
    throw BTException.fromPlatform(e);
  }
}