VLCB-Arduino

CanTransport Interface

CanTransport serves as an interface for implementations of CAN based transports. It handles CANID enumeration and conflict detection that would be the same for all CAN based transports.

The service CanService uses CanTransport derived classes to get and send CANFrame objects. If an incoming CANFrame contains a VLCB message then CanService will create a VlcbMessage object and make it available to the other services. Sending a VlcbMessage will result in a CANFrame that is sent via the CanTransport object.

Implementations of CanTransport must implement the following methods:

available()
returns true if a CANFrame is available for retrieval.
getNextCanFrame()
get the next CAN frame that is available. Note that available() must be called first to ensure that a new CANFrame is available.
sendCanFrame()
send a CAN frame to the CAN bus.

Implementations

This library provides the following concrete transport classes:

SerialGC
Use the GridConnect protocol for sending CAN frames over a serial connection. This is useful for testing a VLCB module with FCU/MMC without the need for setting up a CAN bus.

The following concrete transports exist externally.

VCAN2515
Implementation for using the MCP2515 CAN controller. This has been tested with Arduino Uno/Nano and Raspberry Pi Pico. It should work with any board that compiles with the Arduino IDE.
VCAN2040
Implementation for Raspberry Pi Pico using a software CAN controller. You only need to add a CAN transceiver.
VCANESP32
Implementation for ESP32 boards with an onboard TWAI controller that acts as a CAN controller.