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 ()
 
bool hasNext () 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 45 of file can_listener.h.

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

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, 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 }

◆ hasNext()

bool CanListener::hasNext ( ) const
inline

Definition at line 39 of file can_listener.h.

39 {
40 return m_next;
41 }
CanListener * m_next

Referenced by registerCanListener().

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 return m_next;
37 }

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

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().

Here is the caller graph for this function:

Field Documentation

◆ m_id

const uint32_t CanListener::m_id
private

Definition at line 58 of file can_listener.h.

Referenced by acceptFrame(), and getId().

◆ m_next

CanListener* CanListener::m_next = nullptr
private

Definition at line 56 of file can_listener.h.

Referenced by hasNext(), processFrame(), request(), and setNext().


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