Menu

famouso::mw::nl::CANNL< CAN_Driver, CCP, BP > Class Template Reference

CAN network layer acts as the interface to the Controller Area Network. More...

#include <CANNL.h>

Inheritance diagram for famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >:
famouso::mw::nl::DistinctNL

Data Structures

struct  info

Public Types

typedef uint16_t SNN
typedef Packet< SNNPacket_t
typedef
afp::MultiSubjectConfig< SNN
AFP_Config
 Default AFP configuration of this network layer (see AFP configuration in the Network Layer).

Public Member Functions

 CANNL ()
 ~CANNL ()
void init ()
 Initialises the CAN network layer.
void bind (const Subject &s, SNN &snn)
 bind a subject to a specific network name.
void deliver (const Packet_t &p)
 deliver a packet within using the configured driver
void fetch (Packet_t &p)
 fetches the last received message into a packet
void tx_interrupt ()
 The tx_interrupt is called if the driver is able to send new/further messages. (not yet implemented).
void rx_interrupt ()
 This function is called from the driver-level as reaction to a pysical interrupt that was triggered by the arriving of a CAN message.
SNN lastPacketSNN ()
 Returns the Short Network Name of the last received message.

Detailed Description

template<class CAN_Driver, class CCP, class BP>
class famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >

CAN network layer acts as the interface to the Controller Area Network.

The CANNL allows for using the CAN as a Network Layer within the FAMOUSO middleware. It can use different CAN drivers like SocketCAN, canary from AVR and so on. The CAN-Driver has to fullfill a certain interface. Furthermore the CAN Configuration Protocol is used to ensure uniquenesss of CAN IDs.


Member Typedef Documentation

template<class CAN_Driver , class CCP , class BP >
typedef afp::MultiSubjectConfig<SNN> famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::AFP_Config

Default AFP configuration of this network layer (see AFP configuration in the Network Layer).

template<class CAN_Driver , class CCP , class BP >
typedef Packet<SNN> famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::Packet_t
template<class CAN_Driver , class CCP , class BP >
typedef uint16_t famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::SNN

Constructor & Destructor Documentation

template<class CAN_Driver , class CCP , class BP >
famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::CANNL (  )  [inline]
template<class CAN_Driver , class CCP , class BP >
famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::~CANNL (  )  [inline]

Member Function Documentation

template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::bind ( const Subject s,
SNN snn 
) [inline]

bind a subject to a specific network name.

Parameters:
[in] s Subject of the channel
[out] snn Short Network Name

References TRACE_FUNCTION.

template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::deliver ( const Packet_t p  )  [inline]

deliver a packet within using the configured driver

Parameters:
[in] p packet to be delivered

References Packet< T >::data, Packet< T >::data_length, Packet< T >::fragment, Packet< T >::snn, and TRACE_FUNCTION.

template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::fetch ( Packet_t p  )  [inline]

fetches the last received message into a packet

Parameters:
[out] p packet that is filled with the received data

References Packet< T >::data, Packet< T >::data_length, Packet< T >::fragment, and TRACE_FUNCTION.

template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::init (  )  [inline]

Initialises the CAN network layer.

During this method the parameter of the network layer and the methods for interrupt handling are initialized (see delegates for further references).

References famouso::util::Delegate< parameter, R >::bind(), famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::rx_interrupt(), and TRACE_FUNCTION.

template<class CAN_Driver , class CCP , class BP >
SNN famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::lastPacketSNN (  )  [inline]

Returns the Short Network Name of the last received message.

Returns:
Short Network Name of the last received message.
template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::rx_interrupt (  )  [inline]

This function is called from the driver-level as reaction to a pysical interrupt that was triggered by the arriving of a CAN message.

Todo:
ueber das Auslesen einer CAN Nachricht und deren Zwischenspeichern muss noch mal nachgedacht werden. Insbesonder fuer den AVR ist dies vielleicht nicht immer notwendig bzw der zusaetzliche Speicherbedarf nicht gerechtfertigt.
Todo:
die Code-Introduktions der verschiedenen Protokolle sind ueber Aspecte oder ueber Feature-Orientierte Technicken zu realisieren.

References famouso::mw::el::IncommingEventFromNL, and TRACE_FUNCTION.

Referenced by famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::init().

template<class CAN_Driver , class CCP , class BP >
void famouso::mw::nl::CANNL< CAN_Driver, CCP, BP >::tx_interrupt (  )  [inline]

The tx_interrupt is called if the driver is able to send new/further messages. (not yet implemented).

Todo:
Provide functionality to use tx_interrupt

References TRACE_FUNCTION.


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