writeBytes static method

Future<bool> writeBytes({
  1. required List<int> bytes,
})

Implementation

static Future<bool> writeBytes({required List<int> bytes}) async {
  // To Write Characteristic
  try {
    print("Writing: _macAddressConnect: $_macAddressConnect service: $_serviceSelect caractericsUid: ${_bleCharacteristicSelect?.uuid}");
    await WinBle.write(
      address: _macAddressConnect,
      service: _serviceSelect,
      characteristic: _bleCharacteristicSelect!.uuid,
      data: Uint8List.fromList(bytes),
      writeWithResponse: true,
    );
    return true;
  } catch (e) {
    print("PrintBluettothTermalWindows.writyBytes -> error: $e");
    disconnect();
    return false;
  }
}