Interface ICanBus
Represents a Controller Area Network (CAN) bus interface.
Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface ICanBus
Properties
BitRate
Gets or sets the bus bit rate
View Source
Declaration
CanBitrate BitRate { get; set; }
AcceptanceFilters
The collection of message acceptance filters for the bus
View Source
Declaration
CanAcceptanceFilterCollection AcceptanceFilters { get; }
Methods
WriteFrame(ICanFrame)
Writes a CAN frame to the specified buffer.
View Source
Declaration
void WriteFrame(ICanFrame frame)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.ICanFrame | frame | The CAN frame to write. |
IsFrameAvailable()
Checks if a CAN frame is available to read.
View Source
Declaration
bool IsFrameAvailable()
Returns
System.Boolean
: true
if a frame is available; otherwise, false
.### ReadFrame()
Reads a CAN frame.
View Source
Declaration
ICanFrame? ReadFrame()
Returns
Meadow.Hardware.ICanFrame: The CAN frame if available; otherwise, null
.### ClearReceiveBuffers()
Clears any data currently in the bus receive buffers
View Source
Declaration
void ClearReceiveBuffers()
Events
FrameReceived
Raised when a CAN frame is received.
View Source
Declaration
event EventHandler<ICanFrame>? FrameReceived
Event Type
System.EventHandler<Meadow.Hardware.ICanFrame>
BusError
Raised when a bus error occurs
View Source
Declaration
event EventHandler<CanErrorInfo>? BusError
Event Type
System.EventHandler<Meadow.Hardware.CanErrorInfo>