VLCB
Loading...
Searching...
No Matches
CanTransport.h
Go to the documentation of this file.
1// Copyright (C) Sven Rosvall (sven@rosvall.ie)
2// This file is part of VLCB-Arduino project on https://github.com/SvenRosvall/VLCB-Arduino
3// Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
4// The full licence can be found at: http://creativecommons.org/licenses/by-nc-sa/4.0
5
6#pragma once
7
8#include <Arduino.h>
9#include "Transport.h"
10
11namespace VLCB
12{
13
21{
22 uint32_t id;
23 bool ext;
24 bool rtr;
25 uint8_t len;
26 uint8_t data[8];
27};
28
29
34class CanTransport : public Transport
35{
36public:
38 virtual bool available() = 0;
39 virtual CANFrame getNextCanFrame() = 0;
40 virtual bool sendCanFrame(CANFrame *msg) = 0;
41
42 inline virtual byte getHardwareType() { return 0; }
44};
45
46}
Interface base class for CAN transport implementations.
Definition CanTransport.h:35
virtual bool available()=0
Check if an incoming CAN frame is available on the CAN bus.
virtual bool sendCanFrame(CANFrame *msg)=0
Send a CAN frame to the CAN bus.
virtual byte getHardwareType()
Definition CanTransport.h:42
virtual CANFrame getNextCanFrame()=0
Get the next CAN frame from the CAN bus.
Interface for statistics on the transport layer.
Definition Transport.h:13
Definition AbstractEventTeachingService.cpp:13
Represents a CAN frame sent on the CAN bus.
Definition CanTransport.h:21
bool ext
Definition CanTransport.h:23
uint32_t id
Definition CanTransport.h:22
uint8_t len
Definition CanTransport.h:25
bool rtr
Definition CanTransport.h:24
uint8_t data[8]
Definition CanTransport.h:26