Skip to content

Commit

Permalink
Removed default CanStub
Browse files Browse the repository at this point in the history
  • Loading branch information
Bing-Rover committed Sep 26, 2023
1 parent c6d6445 commit 541a83f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/src/can/socket_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class CanException implements Exception {
/// - Use [sendMessage] to send a message to all devices on the bus
/// - Listen to [incomingMessages] to receive messages from other devices on the bus
abstract class CanSocket {
/// Chooses the right implementation for the platform. Uses a stub on non-Linux platforms.
factory CanSocket() => Platform.isLinux ? CanFFI() : CanStub();
/// Chooses the right implementation for the platform. Uses a stub on non-Linux platforms.
factory CanSocket() => Platform.isLinux ? CanFFI() : CanStub();

/// Starts listening for CAN messages.
void init() { }
void init() { }

/// Disposes of native resources allocated to this object, and stops listening for CAN messages.
void dispose() { }
void dispose() { }

/// Sends a CAN message with the given ID and data.
void sendMessage({required int id, required List<int> data}) { }
void sendMessage({required int id, required List<int> data}) { }

/// A stream of incoming CAN messages. Use [Stream.listen] to handle them.
///
/// This stream returns [CanMessage] objects, which are wrappers around native structs, which
/// needs to be freed after use. Be sure to call [CanMessage.dispose] when you're done using it.
Stream<CanMessage> get incomingMessages;
/// A stream of incoming CAN messages. Use [Stream.listen] to handle them.
///
/// This stream returns [CanMessage] objects, which are wrappers around native structs, which
/// needs to be freed after use. Be sure to call [CanMessage.dispose] when you're done using it.
Stream<CanMessage> get incomingMessages;
}

0 comments on commit 541a83f

Please sign in to comment.