Open YouSour opened 2 years ago
Hi @YouSour
I also face same issue with iOS. Please use this library or add code in your forked library.
lib/blue_print_pos.dart
Remove this code:
final flutter_blue.BluetoothCharacteristic characteristic =
bluetoothService.characteristics.firstWhere(
(flutter_blue.BluetoothCharacteristic bluetoothCharacteristic) =>
bluetoothCharacteristic.properties.write,
);
await characteristic.write(byteBuffer, withoutResponse: true);
Add this code:
final List<flutter_blue.BluetoothCharacteristic>
writableCharacteristics = bluetoothService.characteristics
.where((flutter_blue.BluetoothCharacteristic
bluetoothCharacteristic) =>
bluetoothCharacteristic.properties.write == true)
.toList();
if (writableCharacteristics.isNotEmpty) {
await writableCharacteristics[0]
.write(byteBuffer, withoutResponse: true);
} else {
final List<flutter_blue.BluetoothCharacteristic>
writableWithoutResponseCharacteristics = bluetoothService
.characteristics
.where((flutter_blue.BluetoothCharacteristic
bluetoothCharacteristic) =>
bluetoothCharacteristic.properties.writeWithoutResponse ==
true)
.toList();
if (writableWithoutResponseCharacteristics.isNotEmpty) {
await writableWithoutResponseCharacteristics[0]
.write(byteBuffer, withoutResponse: true);
}
}
Reference:
@ankush-ppie ok, i'll test it later
hi, i just text example code it look like it doesn't with printer MPT-II , it got an error below