rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
CanTransport Class Reference

#include <serial_can.h>

Inheritance diagram for CanTransport:
Inheritance graph
[legend]
Collaboration diagram for CanTransport:
Collaboration graph
[legend]

Public Member Functions

 CanTransport (CanRxMessageSource *p_source)
 
void init ()
 
virtual can_msg_t transmit (CanTxMessage &ctfp, can_sysinterval_t timeout) override
 
virtual can_msg_t receive (CANRxFrame *crfp, can_sysinterval_t timeout) override
 
virtual void onTpFirstFrame () override
 

Data Fields

CanRxMessageSourcesource
 

Detailed Description

Definition at line 33 of file serial_can.h.

Constructor & Destructor Documentation

◆ CanTransport()

CanTransport::CanTransport ( CanRxMessageSource p_source)
inline

Definition at line 35 of file serial_can.h.

35: source(p_source) {}
CanRxMessageSource * source
Definition serial_can.h:42

Member Function Documentation

◆ init()

void CanTransport::init ( )

Definition at line 53 of file serial_can.cpp.

53 {
55}
void registerCanListener(CanListener &listener)
Definition can_rx.cpp:86
static CanTsListener g_listener
Here is the call graph for this function:

◆ onTpFirstFrame()

void CanTransport::onTpFirstFrame ( )
overridevirtual

Implements ICanReceiver.

Definition at line 62 of file serial_can.cpp.

62 {
63 // todo: why nothing? broken iso-tp on ECU side?
64}

◆ receive()

can_msg_t CanTransport::receive ( CANRxFrame crfp,
can_sysinterval_t  timeout 
)
overridevirtual

Implements ICanReceiver.

Definition at line 66 of file serial_can.cpp.

66 {
67 // see CanTsListener and processCanRxMessage()
68 CanRxMessage msg;
69 if (this->source->get(msg, timeout)) {
70 *crfp = msg.frame;
71 return CAN_MSG_OK;
72 }
73 return CAN_MSG_TIMEOUT;
74}
CANRxFrame frame
Definition isotp.h:68
virtual bool get(CanRxMessage &item, int timeout)=0
Here is the call graph for this function:

◆ transmit()

can_msg_t CanTransport::transmit ( CanTxMessage ctfp,
can_sysinterval_t  timeout 
)
overridevirtual

Implements ICanTransmitter.

Definition at line 57 of file serial_can.cpp.

57 {
58 // we do nothing here - see CanTxMessage::~CanTxMessage()
59 return CAN_MSG_OK;
60}

Field Documentation

◆ source

CanRxMessageSource* CanTransport::source

Definition at line 42 of file serial_can.h.

Referenced by receive().


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