STM32Cube Expansion Pack CAN Stack
ComIf Class Referenceabstract

the base class to hold a unique interface to all communication controller interface types More...

#include <ComIf.h>

Inheritance diagram for ComIf:

Public Types

enum  ComInterfaceType { ComInterfaceType::ComIfUnknown = 0, ComInterfaceType::CanIf, ComInterfaceType::TwiIf, ComInterfaceType::FlexRayIf }
 naming the known interface classes More...
 

Public Member Functions

 ComIf (ComInterfaceType ComIfType)
 constructor to initialize the interface type value
 
ComInterfaceType GetComIfType (void)
 get the type of communication controller interface
 
virtual Std_ReturnType Transmit (ComStack_PduType txPduId, const ComStack_PduInfoType *ptr2PduInfo)=0
 Requests transmission of a PDU using the Tx software Buffer. More...
 
virtual Std_ReturnType Receive (ComStack_PduType rxPduId, const ComStack_PduInfoType *ptr2PduInfo)=0
 poll the RxBuffer for a message More...
 
virtual ComStack_PduType GetIfRxPduName (CanIf_UpperLayerType upperLayerName, ComStack_PduType rxPduId)=0
 
virtual ComStack_PduType GetIfTxPduName (CanIf_UpperLayerType upperLayerName, ComStack_PduType txPduId)=0
 
virtual Std_ReturnType ConnectUpperLayerIndication (ComStack_PduType rxPduId, const CanIfUpperLayer *p2UpperLayerObject)=0
 we need to know the connected upper layer object for rx indication More...
 
virtual void RxIndication (ECU_CanController Controller, REF2CONST(ComStack_CanMsgHeader, AUTOMATIC) CanMsgHeader, REF2CONST(ComStack_PduInfoType, AUTOMATIC) PduInfo)=0
 There is a RxIndication function on every ComIf class. More...
 

Private Attributes

const ComInterfaceType connectedComInterface = ComInterfaceType::ComIfUnknown
 to hold the interface type value
 

Detailed Description

the base class to hold a unique interface to all communication controller interface types

This class declares functions that must be known by the controller objects (if exists) and the first level of protocol objects

Definition at line 66 of file ComIf.h.

Member Enumeration Documentation

◆ ComInterfaceType

naming the known interface classes

Enumerator
ComIfUnknown 

unknown interface type

CanIf 

Controller area network (CAN) interface

TwiIf 

two wire interface, maybe I2C (until now just to old the place)

FlexRayIf 

FlexRay interface

Definition at line 70 of file ComIf.h.

Member Function Documentation

◆ ConnectUpperLayerIndication()

virtual Std_ReturnType ComIf::ConnectUpperLayerIndication ( ComStack_PduType  rxPduId,
const CanIfUpperLayer p2UpperLayerObject 
)
pure virtual

we need to know the connected upper layer object for rx indication

maybe we solve this in a static way on code generation later

Parameters
[in]rxPduIdto name the rx pdu
[in]p2UpperLayerObjectto give the pointer to the object

Implemented in CanIf.

◆ Receive()

virtual Std_ReturnType ComIf::Receive ( ComStack_PduType  rxPduId,
const ComStack_PduInfoType ptr2PduInfo 
)
pure virtual

poll the RxBuffer for a message

This function looks if there is an message inside the buffer by checking the PDU name

This is the AUTOSAR like function ReadRxPduData

Parameters
[in]rxPduIdsearch for the PDU by using the CanIf_RxPduIdType
[out]ptr2PduInfoto return the data

Implemented in CanIf.

◆ RxIndication()

virtual void ComIf::RxIndication ( ECU_CanController  Controller,
REF2CONST(ComStack_CanMsgHeader, AUTOMATIC CanMsgHeader,
REF2CONST(ComStack_PduInfoType, AUTOMATIC PduInfo 
)
pure virtual

There is a RxIndication function on every ComIf class.

The service CanIf_RxIndication() is implemented in CanIf and called by CanDrv after a CAN L-PDU has been received.

Implemented in CanIf.

◆ Transmit()

virtual Std_ReturnType ComIf::Transmit ( ComStack_PduType  txPduId,
const ComStack_PduInfoType ptr2PduInfo 
)
pure virtual

Requests transmission of a PDU using the Tx software Buffer.

returns E_NOT_OK if SW buffer full
this function is the AUTOSAR like transmit function

Parameters
[in]txPduIdname the Pdu to transmit
[in]ptr2PduInfopointer to the data to transmit
Returns
Std_ReturnType
Todo:
we should rework to select the CAN Channel by using PDU IDs

Implemented in CanIf.


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