9#define DEBUG_SERIAL Serial
132 void setName(
const char *mname) { module_config->setName(mname); }
154 void sendDGN(
byte serviceIndex,
byte diagCode,
unsigned int counter);
180 bool sendMessageWithNNandData(
VlcbOpCodes opc) {
return sendMessageWithNNandData(opc, 0, 0); }
181 bool sendMessageWithNNandData(
VlcbOpCodes opc,
int len, ...);
184 unsigned int diagMsgsActed = 0;
189 return sendMessageWithNNandData(opc);
194 return sendMessageWithNNandData(opc, 1, b1);
199 return sendMessageWithNNandData(opc, 2, b1, b2);
204 return sendMessageWithNNandData(opc, 3, b1, b2, b3);
209 return sendMessageWithNNandData(opc, 4, b1, b2, b3, b4);
214 return sendMessageWithNNandData(opc, 5, b1, b2, b3, b4, b5);
Definition ArrayHolder.h:17
Definition CircularBuffer.h:15
a class to encapsulate Controller module configuration, events, NVs, EEPROM, etc
Definition Configuration.h:40
bool sendWRACK()
send a WRACK (write acknowledge) message
Definition Controller.cpp:224
bool sendMessageWithNN(VlcbOpCodes opc)
Definition Controller.h:187
void setParamFlag(VlcbParamFlags flag, bool set)
Definition Controller.cpp:151
Controller(Configuration *conf)
Definition Controller.cpp:52
void sendGRSP(VlcbOpCodes opCode, byte serviceType, byte errCode)
Definition Controller.cpp:239
void indicateMode(VlcbModeParams mode)
set the Controller LEDs to indicate the current mode
Definition Controller.cpp:142
Configuration * getModuleConfig() const
Definition Controller.h:130
Parameters & getParams()
Definition Controller.h:138
bool pendingTasks()
Definition Controller.cpp:265
void messageActedOn()
Definition Controller.cpp:270
unsigned int getMessagesActedOn()
Definition Controller.h:167
byte getModuleCANID() const
Definition Controller.h:156
void setName(const char *mname)
Definition Controller.h:132
void setServices(std::initializer_list< Service * > services)
Definition Controller.cpp:84
bool sendCMDERR(byte cerrno)
send a CMDERR (command error) message
Definition Controller.cpp:233
const ArrayHolder< Service * > & getServices()
Definition Controller.h:134
bool pendingAction()
Definition Controller.cpp:260
unsigned char getParam(VlcbParams param) const
Definition Controller.h:139
void sendDGN(byte serviceIndex, byte diagCode, unsigned int counter)
Definition Controller.cpp:244
void putAction(const Action &action)
Definition Controller.cpp:249
void updateParamFlags()
assign the module parameter set
Definition Controller.cpp:110
void indicateActivity()
Definition Controller.cpp:163
const CircularBuffer< Action, ACTION_QUEUE_SIZE > & getActionQueue() const
Definition Controller.h:169
Definition Parameters.h:16
unsigned char * getParams() const
Definition Parameters.h:69
Definition TimedResponse.h:26
Manage tasks that respond with messages at timed intervals.
Definition TimedResponse.h:21
Convenience class for use with initializer lists, i.e. bracketed list of items: { a,...
Definition initializer_list.h:19
Definition AbstractEventTeachingService.cpp:13
bool sendMessage(const VlcbMessage &msg)
Send a VLCB message to the bus.
Definition VLCB.cpp:141
ACTION
Type of Action.
Definition Controller.h:72
@ ACT_INDICATE_MODE
The mode has changed and should be indicated by the user interface.
Definition Controller.h:80
@ ACT_MESSAGE_IN
A message coming in to the node.
Definition Controller.h:73
@ ACT_START_CAN_ENUMERATION
A request to start CAN enumeration from the user interface.
Definition Controller.h:75
@ ACT_INDICATE_ACTIVITY
Some minor activity happened that should be indicated by the user interface.
Definition Controller.h:78
@ ACT_INDICATE_WORK
Some work for the node occurred and should be indicated by the user interface.
Definition Controller.h:79
@ ACT_RENEGOTIATE
A request to change node number from the user interface.
Definition Controller.h:77
@ ACT_MESSAGE_OUT
A message sent out from the node.
Definition Controller.h:74
@ ACT_CHANGE_MODE
A request to change mode from the user interface.
Definition Controller.h:76
bool sendMessageWithNN(VlcbOpCodes opc)
Definition VLCB.cpp:146
const int ACTION_QUEUE_SIZE
Definition Controller.h:24
void begin()
Definition VLCB.cpp:186
void addTimedResponseTask(TimedResponse::Task *task)
Add a task that produces a number for response messages in a timed fashion.
Definition VLCB.cpp:171
void process()
Definition VLCB.cpp:192
An action to be performed.
Definition Controller.h:86
enum ACTION actionType
Type of action.
Definition Controller.h:87
Action(ACTION type, const VlcbMessage &msg)
Definition Controller.h:106
Action(ACTION type, bool fromENUM)
Definition Controller.h:102
Action(ACTION type, VlcbModeParams mode)
Definition Controller.h:110
Action(ACTION type)
Definition Controller.h:97
VLCB message type.
Definition Controller.h:38
uint8_t len
Definition Controller.h:39
VlcbMessage(uint8_t len, uint8_t data[])
Construct a message from existing data.
Definition Controller.h:45
VlcbMessage & addNNEN(byte nn_en[EE_HASH_BYTES])
Add an event identifier (NN/EN) to the message.
Definition Controller.cpp:43
VlcbMessage & addNN(unsigned int nn)
Add a node number (two bytes) to the message.
Definition Controller.h:63
VlcbMessage & add2Bytes(unsigned int n)
Add a number as two bytes of data to the message.
Definition Controller.cpp:36
VlcbMessage(VlcbOpCodes opc)
Construct a message and populate the message OP-code.
Definition Controller.h:52
VlcbMessage & addData(byte b)
Add a data byte to the message.
Definition Controller.cpp:30
VlcbMessage & addEN(unsigned int en)
Add an event number (two bytes) to the message.
Definition Controller.h:65
uint8_t data[8]
Definition Controller.h:40
VlcbMessage vlcbMessage
with ACT_MESSAGE_IN & ACT_MESSAGE_OUT
bool fromENUM
with ACT_START_CAN_ENUMERATION
VlcbModeParams mode
with ACT_INDICATE_MODE
VlcbParams
Definition vlcbdefs.hpp:507
VlcbModeParams
Definition vlcbdefs.hpp:562
VlcbParamFlags
Definition vlcbdefs.hpp:544
VlcbOpCodes
Definition vlcbdefs.hpp:188