rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes
CanListener Class Referenceabstract

#include <can_listener.h>

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

Public Member Functions

 CanListener (uint32_t id)
 
CanListenerprocessFrame (const size_t busIndex, const CANRxFrame &frame, efitick_t nowNt)
 
uint32_t getId ()
 
void setNext (CanListener *next)
 
virtual CanListenerrequest ()
 
CanListenergetNext () const
 
virtual bool acceptFrame (const size_t busIndex, const CANRxFrame &frame) const
 

Protected Member Functions

virtual void decodeFrame (const CANRxFrame &frame, efitick_t nowNt)=0
 

Private Attributes

CanListenerm_next = nullptr
 
const uint32_t m_id
 

Detailed Description

Definition at line 12 of file can_listener.h.

Constructor & Destructor Documentation

◆ CanListener()

CanListener::CanListener ( uint32_t  id)
inline

Definition at line 14 of file can_listener.h.

15 : m_id(id)
16 {
17 }
const uint32_t m_id

Member Function Documentation

◆ acceptFrame()

virtual bool CanListener::acceptFrame ( const size_t  busIndex,
const CANRxFrame frame 
) const
inlinevirtual

Reimplemented in AemXSeriesWideband.

Definition at line 46 of file can_listener.h.

46 {
47 /* accept from all buses */
48 (void)busIndex;
49
50 return CAN_ID(frame) == m_id;
51 }

Referenced by processFrame().

Here is the caller graph for this function:

◆ decodeFrame()

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

Implemented in CanTsListener, IsoTpRx, CanSensor< TStorage, TScale >, ObdCanSensor< Size, Offset >, AemXSeriesEgt, and AemXSeriesWideband.

Referenced by processFrame().

Here is the caller graph for this function:

◆ getId()

uint32_t CanListener::getId ( )
inline

Definition at line 27 of file can_listener.h.

27 {
28 return m_id;
29 }

◆ getNext()

CanListener * CanListener::getNext ( ) const
inline

Definition at line 40 of file can_listener.h.

40 {
41 return m_next;
42 }
CanListener * m_next

Referenced by registerCanListener(), request(), and unregisterCanListener().

Here is the caller graph for this function:

◆ processFrame()

CanListener * CanListener::processFrame ( const size_t  busIndex,
const CANRxFrame frame,
efitick_t  nowNt 
)
inline

Definition at line 19 of file can_listener.h.

19 {
20 if (acceptFrame(busIndex, frame)) {
21 decodeFrame(frame, nowNt);
22 }
23
24 return m_next;
25 }
virtual void decodeFrame(const CANRxFrame &frame, efitick_t nowNt)=0
virtual bool acceptFrame(const size_t busIndex, const CANRxFrame &frame) const

Referenced by serviceCanSubscribers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ request()

virtual CanListener * CanListener::request ( void  )
inlinevirtual

Reimplemented in ObdCanSensor< Size, Offset >.

Definition at line 35 of file can_listener.h.

35 {
36 // NOP and return next in list
37 return getNext();
38 }
CanListener * getNext() const

Referenced by CanWrite::PeriodicTask(), and ObdCanSensor< Size, Offset >::request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNext()

void CanListener::setNext ( CanListener next)
inline

Definition at line 31 of file can_listener.h.

31 {
32 m_next = next;
33 }

Referenced by registerCanListener(), and unregisterCanListener().

Here is the caller graph for this function:

Field Documentation

◆ m_id

const uint32_t CanListener::m_id
private

Definition at line 59 of file can_listener.h.

Referenced by acceptFrame(), and getId().

◆ m_next

CanListener* CanListener::m_next = nullptr
private

Definition at line 57 of file can_listener.h.

Referenced by getNext(), processFrame(), and setNext().


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