AMS Advanced Air Mobility Sensors UG
Loading...
Searching...
No Matches
CCanHandler Class Reference

CAN General Handler software component. More...

Inheritance diagram for CCanHandler:
CSoftwareComponent< CCanHandler, 1U >

Classes

struct  SCanasPlatform
 Platform-specific data. More...

Public Member Functions

void Init () override
bool IsInitialized () override
Public Member Functions inherited from CSoftwareComponent< CCanHandler, 1U >
 CSoftwareComponent (CSoftwareComponent &)=delete
CSoftwareComponentoperator= (const CSoftwareComponent &orOther)=delete

Static Public Member Functions

static void ReceiveCanFrames ()
 CAN Listener.
Static Public Member Functions inherited from CSoftwareComponent< CCanHandler, 1U >
static CCanHandlerGetInstance (unsigned uInstanceIndex=0U)

Public Attributes

CanasInstance oCanasInstance
 CAN Aerospace instance object.
SCanasPlatform oCanasPlatform
 CAN Aerospace Platform specific.

Static Public Attributes

static constexpr int32_t skiMallocSize { 1024 }
 Static Malloc size in bytes.
static constexpr uint32_t skuMutexTout { 1 }
 CAN Aerospace mutex timeout.
Static Public Attributes inherited from CSoftwareComponent< CCanHandler, 1U >
static constexpr unsigned skuInstanceCount_

Private Member Functions

 CCanHandler (CCanHandler &)=delete
 CCanHandler (CCanHandler &&)=delete
CCanHandleroperator= (const CCanHandler &orOther)=delete
CCanHandleroperator= (CCanHandler &&orOther)=delete
 CCanHandler ()
 ~CCanHandler ()=default

Static Private Member Functions

static CCanHandlergetInstanceImpl (unsigned uInstanceIndex)
static int drvSend (CanasInstance *opInstance, int iIface, const CanasCanFrame *kopFrame)
 Send a message to the bus.
static int drvFilter (CanasInstance *opInstance, int iIface, const CanasCanFilterConfig *kopFilters, int iNumFilt)
 Configure acceptance filters.
static void * staticMalloc (CanasInstance *opInstance, int iSize)
 Allocates a chunk of memory. If the application does not require de-initialization features like unsubscription of unadvertisement, then dynamic memory is not needed at all. If this is the case, you can use a static pool allocator. This feature is useful for embedded systems where dynamic memory is not always available.
static uint64_t getTimestamp (CanasInstance *opInstance)
 Returns current timestamp in microseconds. Any base value (uptime or UNIX time) will do.

Private Attributes

bool bIsInitialized_ { false }
osMutexAttr_t oMutexAttr_

Friends

class CSoftwareComponent< CCanHandler, 1U >

Additional Inherited Members

Protected Member Functions inherited from CSoftwareComponent< CCanHandler, 1U >
 ~CSoftwareComponent ()=default

Detailed Description

CAN General Handler software component.

Constructor & Destructor Documentation

◆ CCanHandler() [1/3]

CCanHandler::CCanHandler ( CCanHandler & )
privatedelete

◆ CCanHandler() [2/3]

CCanHandler::CCanHandler ( CCanHandler && )
privatedelete

◆ CCanHandler() [3/3]

CCanHandler::CCanHandler ( )
private

◆ ~CCanHandler()

CCanHandler::~CCanHandler ( )
privatedefault

Member Function Documentation

◆ drvFilter()

int CCanHandler::drvFilter ( CanasInstance * opInstance,
int iIface,
const CanasCanFilterConfig * kopFilters,
int iNumFilt )
staticprivate

Configure acceptance filters.

Parameters
[in]opInstanceInstance pointer
[in]iIfaceInterface index
[in]kopFiltersPointer to the filter configuration
[in]iNumFiltNumber of configured filters
Returns
0 if ok, negative on failure

◆ drvSend()

int CCanHandler::drvSend ( CanasInstance * opInstance,
int iIface,
const CanasCanFrame * kopFrame )
inlinestaticprivate

Send a message to the bus.

Parameters
[in]opInstanceInstance pointer
[in]iIfaceInterface index
[in]kopFramePointer to the message to be sent
Returns
Number of messages sent (0 or 1), negative on failure

◆ getInstanceImpl()

CCanHandler & CCanHandler::getInstanceImpl ( unsigned uInstanceIndex)
staticprivate

◆ getTimestamp()

uint64_t CCanHandler::getTimestamp ( CanasInstance * opInstance)
staticprivate

Returns current timestamp in microseconds. Any base value (uptime or UNIX time) will do.

Parameters
[in]opInstanceInstance pointer
Returns
Current timestamp in microseconds

◆ Init()

void CCanHandler::Init ( )
overridevirtual

Initialize the software component.

Implements CSoftwareComponent< CCanHandler, 1U >.

◆ IsInitialized()

bool CCanHandler::IsInitialized ( )
overridevirtual

Get initialization status of the software component.

Returns
True – the component is initialized, false otherwise.

Implements CSoftwareComponent< CCanHandler, 1U >.

◆ operator=() [1/2]

CCanHandler & CCanHandler::operator= ( CCanHandler && orOther)
privatedelete

◆ operator=() [2/2]

CCanHandler & CCanHandler::operator= ( const CCanHandler & orOther)
privatedelete

◆ ReceiveCanFrames()

void CCanHandler::ReceiveCanFrames ( )
static

CAN Listener.

◆ staticMalloc()

void * CCanHandler::staticMalloc ( CanasInstance * opInstance,
int iSize )
staticprivate

Allocates a chunk of memory. If the application does not require de-initialization features like unsubscription of unadvertisement, then dynamic memory is not needed at all. If this is the case, you can use a static pool allocator. This feature is useful for embedded systems where dynamic memory is not always available.

Note
Allocated memory must be aligned properly.
Parameters
[in]opInstanceInstance pointer
[in]iSizeSize of the memory block required
Returns
Pointer or NULL if no memory available

◆ CSoftwareComponent< CCanHandler, 1U >

friend class CSoftwareComponent< CCanHandler, 1U >
friend

Member Data Documentation

◆ bIsInitialized_

bool CCanHandler::bIsInitialized_ { false }
private

◆ oCanasInstance

CanasInstance CCanHandler::oCanasInstance

CAN Aerospace instance object.

◆ oCanasPlatform

SCanasPlatform CCanHandler::oCanasPlatform

CAN Aerospace Platform specific.

◆ oMutexAttr_

osMutexAttr_t CCanHandler::oMutexAttr_
private

◆ skiMallocSize

int32_t CCanHandler::skiMallocSize { 1024 }
staticconstexpr

Static Malloc size in bytes.

◆ skuMutexTout

uint32_t CCanHandler::skuMutexTout { 1 }
staticconstexpr

CAN Aerospace mutex timeout.


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