CanSocket class
A CAN socket, a CAN device that's opened for reading and writing.
A CanSocket will not only receive frames incoming on the underlying CanDevice, but also frames outgoing on other CanSockets of the same CanDevice. (This behaviour is dictated by the kernel SocketCAN implementation)
Constructors
- CanSocket.new({required PlatformInterface platformInterface, required int fd, required NetworkInterface networkInterface})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- networkInterface → NetworkInterface
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendBufSize ↔ int
-
Returns the current send buffer size of this socket.
getter/setter pair
Methods
-
add(
CanFrame data, {bool block = true}) → Future< void> -
Sends the base/extended CAN 2.0 frame
frame
using this socket.override -
close(
) → Future< void> -
Closes this CanSocket and releases all associated resources.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
receive(
{bool emitErrors = false, CanFilter filter = CanFilter.anyData}) → Stream< CanFrame> - Gets a broadcast stream of CanFrames arriving on this socket.
-
receiveSingle(
{bool emitErrors = false, CanFilter filter = CanFilter.anyData}) → Future< CanFrame> - Receives a base/extended CAN 2.0 CanFrame using this socket.
-
send(
CanFrame frame, {bool block = true}) → Future< void> -
Sends the base/extended CAN 2.0 frame
frame
using this socket. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited