modm API documentation
TestingCanConnector Class Reference
Inheritance diagram for TestingCanConnector:
xpcc::CanConnector< modm_test::platform::CanDriver > xpcc::CanConnectorBase xpcc::BackendInterface

Public Member Functions

 TestingCanConnector (modm_test::platform::CanDriver *driver)
 
virtual void dropPacket ()
 
virtual const Header & getPacketHeader () const
 Access the packet.
 
virtual const modm::SmartPointer getPacketPayload () const
 
virtual bool isPacketAvailable () const
 Check if a new packet was received by the backend.
 
virtual void sendPacket (const Header &header, modm::SmartPointer payload)
 Send a Message.
 
virtual void update ()
 

Protected Typedefs

typedef modm::LinkedList< ReceiveListItem > ReceiveList
 
typedef modm::LinkedList< SendListItem > SendList
 

Protected Member Functions

bool retrieveMessage ()
 
bool sendMessage (const uint32_t &identifier, const uint8_t *data, uint8_t size)
 Try to send a CAN message via CAN Driver. More...
 
void sendWaitingMessages ()
 

Static Protected Member Functions

static bool convertToHeader (const uint32_t &identifier, Header &header)
 Convert a can identifier to a packet header. More...
 
static uint32_t convertToIdentifier (const Header &header, bool fragmentated)
 Convert a packet header to a can identifier.
 
static uint8_t getNumberOfFragments (uint8_t messageSize)
 Calculate the number of fragments needed to send a message with a length of messageSize.
 
static bool isFragment (const uint32_t &identifier)
 

Protected Attributes

modm_test::platform::CanDrivercanDriver
 
ReceiveList pendingMessages
 
ReceiveList receivedMessages
 
SendList sendList
 

Static Protected Attributes

static uint8_t messageCounter = 0
 

Member Function Documentation

bool xpcc::CanConnectorBase::convertToHeader ( const uint32_t &  identifier,
xpcc::Header header 
)
inheritedstatic

Convert a can identifier to a packet header.

Parameters
[in]identifier29-bit CAN identifier
[out]headerPacket header
Returns
true if the message is part of a fragmented packet, false otherwise.
bool xpcc::CanConnector< modm_test::platform::CanDriver >::sendMessage ( const uint32_t &  identifier,
const uint8_t *  data,
uint8_t  size 
)
inheritedprotected

Try to send a CAN message via CAN Driver.

Returns
true if the message could be send, false otherwise

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