Skip to content

Commit

Permalink
Added BurtFirmwareSerial.sendMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Lesches committed Sep 26, 2024
1 parent f0d26ab commit 36c8f00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/src/serial/firmware.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "package:protobuf/protobuf.dart";

import "package:burt_network/burt_network.dart";


/// Represents a firmware device connected over Serial.
///
/// This device starts with an unknown [device]. Calling [init] starts a handshake with the device
Expand Down Expand Up @@ -104,9 +103,12 @@ class BurtFirmwareSerial extends Service {
return true;
}

/// Sends bytes to the device via Serial.
/// Sends bytes to the device.
void sendBytes(List<int> bytes) => _serial.write(Uint8List.fromList(bytes));

/// Sends a Protobuf message to the device.
void sendMessage(Message message) => _serial.write(message.writeToBuffer());

/// Resets the device and closes the port.
@override
Future<void> dispose() async {
Expand Down

0 comments on commit 36c8f00

Please sign in to comment.