VLCB
Loading...
Searching...
No Matches
VLCB::Controller Class Reference

Main object in VLCB. Coordinates transport, ui, configuration and services. More...

#include <Controller.h>

Public Member Functions

 Controller (Configuration *conf)
 Controller (Configuration *conf, std::initializer_list< Service * > services)
void setServices (std::initializer_list< Service * > services)
ConfigurationgetModuleConfig () const
void setName (const char *mname)
const ArrayHolder< Service * > & getServices ()
void updateParamFlags ()
 assign the module parameter set
void setParamFlag (VlcbParamFlags flag, bool set)
ParametersgetParams ()
unsigned char getParam (VlcbParams param) const
bool sendMessage (const VlcbMessage *msg)
void begin ()
 Initialise VLCB.
bool sendMessageWithNN (VlcbOpCodes opc)
bool sendMessageWithNN (VlcbOpCodes opc, byte b1)
bool sendMessageWithNN (VlcbOpCodes opc, byte b1, byte b2)
bool sendMessageWithNN (VlcbOpCodes opc, byte b1, byte b2, byte b3)
bool sendMessageWithNN (VlcbOpCodes opc, byte b1, byte b2, byte b3, byte b4)
bool sendMessageWithNN (VlcbOpCodes opc, byte b1, byte b2, byte b3, byte b4, byte b5)
bool sendWRACK ()
 send a WRACK (write acknowledge) message
bool sendCMDERR (byte cerrno)
 send a CMDERR (command error) message
void sendGRSP (VlcbOpCodes opCode, byte serviceType, byte errCode)
void sendDGN (byte serviceIndex, byte diagCode, unsigned int counter)
byte getModuleCANID () const
void process ()
 main Controller message processing procedure
void indicateMode (VlcbModeParams mode)
 set the Controller LEDs to indicate the current mode
void indicateActivity ()
void putAction (const Action &action)
void putAction (ACTION action)
bool pendingAction ()
bool pendingTasks ()
void messageActedOn ()
unsigned int getMessagesActedOn ()
const CircularBuffer< Action, ACTION_QUEUE_SIZE > & getActionQueue () const
void addTimedResponseTask (TimedResponse::Task *task)

Detailed Description

Main object in VLCB. Coordinates transport, ui, configuration and services.

Constructor & Destructor Documentation

◆ Controller() [1/2]

VLCB::Controller::Controller ( Configuration * conf)

◆ Controller() [2/2]

VLCB::Controller::Controller ( Configuration * conf,
std::initializer_list< Service * > services )

construct a Controller object with a Configuration object that the user provides. note that this Configuration object must have a lifetime longer than the Controller object.

Member Function Documentation

◆ setServices()

void VLCB::Controller::setServices ( std::initializer_list< Service * > services)

◆ getModuleConfig()

Configuration * VLCB::Controller::getModuleConfig ( ) const
inline

◆ setName()

void VLCB::Controller::setName ( const char * mname)
inline

◆ getServices()

const ArrayHolder< Service * > & VLCB::Controller::getServices ( )
inline

◆ updateParamFlags()

void VLCB::Controller::updateParamFlags ( )

assign the module parameter set

◆ setParamFlag()

void VLCB::Controller::setParamFlag ( VlcbParamFlags flag,
bool set )

◆ getParams()

Parameters & VLCB::Controller::getParams ( )
inline

◆ getParam()

unsigned char VLCB::Controller::getParam ( VlcbParams param) const
inline

◆ sendMessage()

bool VLCB::Controller::sendMessage ( const VlcbMessage * msg)

◆ begin()

void VLCB::Controller::begin ( )

Initialise VLCB.

◆ sendMessageWithNN() [1/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc)
inline

◆ sendMessageWithNN() [2/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc,
byte b1 )
inline

◆ sendMessageWithNN() [3/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc,
byte b1,
byte b2 )
inline

◆ sendMessageWithNN() [4/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc,
byte b1,
byte b2,
byte b3 )
inline

◆ sendMessageWithNN() [5/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc,
byte b1,
byte b2,
byte b3,
byte b4 )
inline

◆ sendMessageWithNN() [6/6]

bool VLCB::Controller::sendMessageWithNN ( VlcbOpCodes opc,
byte b1,
byte b2,
byte b3,
byte b4,
byte b5 )
inline

◆ sendWRACK()

bool VLCB::Controller::sendWRACK ( )

send a WRACK (write acknowledge) message

◆ sendCMDERR()

bool VLCB::Controller::sendCMDERR ( byte cerrno)

send a CMDERR (command error) message

◆ sendGRSP()

void VLCB::Controller::sendGRSP ( VlcbOpCodes opCode,
byte serviceType,
byte errCode )

◆ sendDGN()

void VLCB::Controller::sendDGN ( byte serviceIndex,
byte diagCode,
unsigned int counter )

◆ getModuleCANID()

byte VLCB::Controller::getModuleCANID ( ) const
inline

◆ process()

void VLCB::Controller::process ( )

main Controller message processing procedure

◆ indicateMode()

void VLCB::Controller::indicateMode ( VlcbModeParams mode)

set the Controller LEDs to indicate the current mode

◆ indicateActivity()

void VLCB::Controller::indicateActivity ( )

◆ putAction() [1/2]

void VLCB::Controller::putAction ( const Action & action)

◆ putAction() [2/2]

void VLCB::Controller::putAction ( ACTION action)

◆ pendingAction()

bool VLCB::Controller::pendingAction ( )

◆ pendingTasks()

bool VLCB::Controller::pendingTasks ( )

◆ messageActedOn()

void VLCB::Controller::messageActedOn ( )

◆ getMessagesActedOn()

unsigned int VLCB::Controller::getMessagesActedOn ( )
inline

◆ getActionQueue()

const CircularBuffer< Action, ACTION_QUEUE_SIZE > & VLCB::Controller::getActionQueue ( ) const
inline

◆ addTimedResponseTask()

void VLCB::Controller::addTimedResponseTask ( TimedResponse::Task * task)

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