Public Types | Public Member Functions | Private Attributes | List of all members
CanItf Class Referenceabstract

#include <CanItf.h>

Inheritance diagram for CanItf:
Inheritance graph
[legend]

Public Types

enum  CanItfType {
  CAN_PEAK = 0, CAN_PEAK_USB = 1, CAN_ESD = 2, CAN_DUMMY = 3,
  CAN_BECKHOFF = 4, CAN_SOCKETCAN = 5
}
 

Public Member Functions

CanItfType getCanItfType ()
 
virtual void init ()=0
 
virtual bool init_ret ()=0
 
virtual bool isObjectMode ()=0
 
virtual bool receiveMsg (CanMsg *pCMsg)=0
 
virtual bool receiveMsgRetry (CanMsg *pCMsg, int iNrOfRetry)=0
 
virtual bool receiveMsgTimeout (CanMsg *pCMsg, int nMicroSecTimeout)=0
 
void setCanItfType (CanItfType iType)
 
virtual bool transmitMsg (CanMsg CMsg, bool bBlocking=true)=0
 
virtual ~CanItf ()
 

Private Attributes

CanItfType m_iCanItfType
 The CAN interface type. More...
 

Detailed Description

General interface of the CAN bus.

Definition at line 44 of file CanItf.h.

Member Enumeration Documentation

◆ CanItfType

Enumerator
CAN_PEAK 
CAN_PEAK_USB 
CAN_ESD 
CAN_DUMMY 
CAN_BECKHOFF 
CAN_SOCKETCAN 

Definition at line 47 of file CanItf.h.

Constructor & Destructor Documentation

◆ ~CanItf()

virtual CanItf::~CanItf ( )
inlinevirtual

The destructor does not necessarily have to be overwritten. But it makes sense to close any resources like handles.

Definition at line 60 of file CanItf.h.

Member Function Documentation

◆ getCanItfType()

CanItfType CanItf::getCanItfType ( )
inline

Get the CAN interface type. This is necessary to implement a proper CAN bus simulation.

Returns
The CAN interface type.

Definition at line 121 of file CanItf.h.

◆ init()

virtual void CanItf::init ( )
pure virtual

Initializes the CAN bus.

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ init_ret()

virtual bool CanItf::init_ret ( )
pure virtual

Initializes the CAN bus and returns success.

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ isObjectMode()

virtual bool CanItf::isObjectMode ( )
pure virtual

Check if the current CAN interface was opened on OBJECT mode.

Returns
true if opened in OBJECT mode, false if not.

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ receiveMsg()

virtual bool CanItf::receiveMsg ( CanMsg pCMsg)
pure virtual

Reads a CAN message.

Returns
true if a message is available

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ receiveMsgRetry()

virtual bool CanItf::receiveMsgRetry ( CanMsg pCMsg,
int  iNrOfRetry 
)
pure virtual

Reads a CAN message. The function blocks between the attempts.

Parameters
pCMsgCAN message
iNrOfRetrynumber of retries
Returns
true if a message is available

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ receiveMsgTimeout()

virtual bool CanItf::receiveMsgTimeout ( CanMsg pCMsg,
int  nMicroSecTimeout 
)
pure virtual

Reads a CAN message with timeout.

Parameters
pCMsgCAN message
nMicroSecTimeouttimeout in us
Returns
true if a message is available

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

◆ setCanItfType()

void CanItf::setCanItfType ( CanItfType  iType)
inline

Set the CAN interface type. This is necessary to implement a proper CAN bus simulation.

Parameters
iTypeThe CAN interface type.

Definition at line 114 of file CanItf.h.

◆ transmitMsg()

virtual bool CanItf::transmitMsg ( CanMsg  CMsg,
bool  bBlocking = true 
)
pure virtual

Sends a CAN message.

Parameters
pCMsgCAN message
bBlockingspecifies whether send should be blocking or non-blocking

Implemented in CanESD, SocketCan, CANPeakSysUSB, and CanPeakSys.

Member Data Documentation

◆ m_iCanItfType

CanItfType CanItf::m_iCanItfType
private

The CAN interface type.

Definition at line 125 of file CanItf.h.


The documentation for this class was generated from the following file:


cob_generic_can
Author(s): Christian Connette
autogenerated on Thu Nov 17 2022 03:17:42