sendData method
Send data to connected device
Implementation
@override
Future<void> sendData(Uint8List data) async {
if (_currentState != BluetoothConnectionState.connected) {
throw BluetoothException('Not connected to any device');
}
try {
await _methodChannel.invokeMethod('sendData', {
'data': data,
});
} catch (e) {
throw BluetoothException('Failed to send data: $e');
}
}