flutter_bluetooth_serial
flutter_bluetooth_serial copied to clipboard
Need Send Hex String and WriteBytes Not Supported
i try to send hex string and change to hex byte to embedded system. but seems the library only support for send by string.
The library actually only supports directly sending bytes, so if you convert your data into a Uint8List (flutter data type for holding multiple bytes), you could easily send raw bytes, without converting to a string.
import 'dart:typed_data';
import 'package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart';
BluetoothConnection connection;
...
Uint8List dataInBytes;
connection.output.add(dataInBytes);