rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
CanTsListener Class Reference

#include <serial_can.h>

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

Public Member Functions

 CanTsListener ()
 
virtual void decodeFrame (const CANRxFrame &frame, efitick_t nowNt)
 
bool get (CanRxMessage &item, int timeout)
 
- Public Member Functions inherited from CanListener
 CanListener (uint32_t id)
 
CanListenerprocessFrame (const size_t busIndex, const CANRxFrame &frame, efitick_t nowNt)
 
uint32_t getId ()
 
void setNext (CanListener *next)
 
virtual CanListenerrequest ()
 
bool hasNext () const
 
virtual bool acceptFrame (const size_t busIndex, const CANRxFrame &frame) const
 

Protected Attributes

fifo_buffer_sync< CanRxMessage, CAN_FIFO_FRAME_SIZE > rxFifo
 

Additional Inherited Members

Detailed Description

Definition at line 111 of file serial_can.h.

Constructor & Destructor Documentation

◆ CanTsListener()

CanTsListener::CanTsListener ( )
inline

Definition at line 113 of file serial_can.h.

114 : CanListener(CAN_ECU_SERIAL_RX_ID)
115 {
116 }

Member Function Documentation

◆ decodeFrame()

void CanTsListener::decodeFrame ( const CANRxFrame frame,
efitick_t  nowNt 
)
virtual

incoming data main entry point

Implements CanListener.

Definition at line 361 of file serial_can.cpp.

361 {
362 // CAN ID filtering happens in base class, by the time we are here we know it's the CAN_ECU_SERIAL_RX_ID packet
363 // todo: what if the FIFO is full?
364 CanRxMessage msg(frame);
366 PRINT("*** INFO: CanTsListener decodeFrame %d" PRINT_EOL, isoTpPacketCounter++);
367 }
368 if (!rxFifo.put(msg)) {
369 warning(ObdCode::CUSTOM_ERR_CAN_COMMUNICATION, "CAN sendDataTimeout() problems");
370 }
371}
fifo_buffer_sync< CanRxMessage, CAN_FIFO_FRAME_SIZE > rxFifo
Definition serial_can.h:125
static constexpr engine_configuration_s * engineConfiguration
bool warning(ObdCode code, const char *fmt,...)
@ CUSTOM_ERR_CAN_COMMUNICATION
static int isoTpPacketCounter
Here is the call graph for this function:

◆ get()

bool CanTsListener::get ( CanRxMessage item,
int  timeout 
)
inline

Definition at line 120 of file serial_can.h.

120 {
121 return rxFifo.get(item, timeout);
122 }

Referenced by CanStreamer::receive().

Here is the caller graph for this function:

Field Documentation

◆ rxFifo

fifo_buffer_sync<CanRxMessage, CAN_FIFO_FRAME_SIZE> CanTsListener::rxFifo
protected

Definition at line 125 of file serial_can.h.

Referenced by decodeFrame(), and get().


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