|
mergCanBus
|
#include <Message.h>
Public Member Functions | |
| Message () | |
| Message (unsigned int canId, unsigned int opc, unsigned int nodeNumber, unsigned int eventNumber, byte data[CANDATA_SIZE], unsigned int priority) | |
| virtual | ~Message () |
| byte | getByte (byte pos) |
| byte * | getDataBuffer () |
| void | setDataBuffer (byte val[CANDATA_SIZE]) |
| byte * | getHeaderBuffer () |
| void | setHeaderBuffer (byte val[HEADER_SIZE]) |
| byte | getCanId () |
| void | setCanId (byte val) |
| byte | getOpc () |
| void | setOpc (byte val) |
| message_type | getType () |
| void | setType (message_type val) |
| unsigned int | getEventNumber () |
| void | setEventNumber (unsigned int val) |
| unsigned int | getNodeNumber () |
| void | setNodeNumber (unsigned int val) |
| unsigned int | getDeviceNumber () |
| void | setDeviceNumber (unsigned int val) |
| byte | getPriority () |
| void | setPriority (byte val) |
| byte | getMessageSize () |
| unsigned int | getNumBytes () |
| void | setNumBytes (unsigned int val) |
| void | setRTR () |
| void | unsetRTR () |
| bool | getRTR () |
| void | setSession (byte val) |
| byte | getSession () |
| unsigned int | getDecoder () |
| void | setDecoder (unsigned int val) |
| unsigned int | getCV () |
| void | setCV (unsigned int val) |
| unsigned int | getCVMode () |
| unsigned int | getCVValue () |
| byte | getConsist () |
| byte | getSpeedDir () |
| byte | getEngineFlag () |
| byte | getAvailableEventsLeft () |
| byte | getStoredEvents () |
| byte | getFunctionNumber () |
| byte | functionValue () |
| byte | getStatus () |
| byte | getParaIndex () |
| byte | getParameter () |
| byte | getNodeVariableIndex () |
| byte | getNodeVariable () |
| byte | getEventIndex () |
| byte | getEventVarIndex () |
| byte | getEventVar () |
| void | clear () |
| void | setDebug (bool val) |
| byte | getCanMessageSize () |
| void | setCanMessageSize (byte val) |
| bool | isAccOn () |
| bool | isAccOff () |
| bool | isLongEvent () |
| bool | isShortEvent () |
| byte | accExtraData () |
| byte | getAccExtraData (byte idx) |
| void | createOnEvent (unsigned int nodeNumber, bool longEvent, unsigned int eventNumber, byte numDataBytes, byte *data) |
| void | createOffEvent (unsigned int nodeNumber, bool longEvent, unsigned int eventNumber, byte numDataBytes, byte *data) |
The Message class holds the detailed information about a can message. If works as a wrapper class over the can bus message. It extracts the information from the message based on the semantics of the message OPC. Still in fase of modification and cleanning.
| Message::Message | ( | ) |
Constructor Clear the internal buffers and load the basic configuration.
| Message::Message | ( | unsigned int | canId, |
| unsigned int | opc, | ||
| unsigned int | nodeNumber, | ||
| unsigned int | eventNumber, | ||
| byte | data[CANDATA_SIZE], | ||
| unsigned int | priority | ||
| ) |
Creates a message to be sent. Not being used.
|
virtual |
Destructor
| byte Message::accExtraData | ( | ) |
Return how many bytes of extra data has the ON event.
| void Message::clear | ( | ) |
Clear the internal structure.
| byte Message::functionValue | ( | ) |
Get the function value for DCC messages
| byte Message::getAccExtraData | ( | byte | idx | ) |
Get the extra data byte on an ON or OFF event.
| byte Message::getAvailableEventsLeft | ( | ) |
Get the space left to store events
| byte Message::getByte | ( | byte | pos | ) |
Used to get the data fields directly
| pos | Byte position. |
| byte Message::getCanId | ( | ) |
Get the Can id from the header.
| byte Message::getCanMessageSize | ( | ) |
Get the message size. Extract it from the can frame.
| byte Message::getConsist | ( | ) |
Get the consist value for DCC messages
| unsigned int Message::getCV | ( | ) |
Get the decoder id for DCC messages
| unsigned int Message::getCVMode | ( | ) |
Get the cv mode value for DCC messages
| unsigned int Message::getCVValue | ( | ) |
Get the cv value for DCC messages
| unsigned int Message::getDecoder | ( | ) |
Get the decoder id for DCC messages
| unsigned int Message::getDeviceNumber | ( | ) |
Get the device number
| byte Message::getEngineFlag | ( | ) |
Get the engine flags for DCC messages
| byte Message::getEventIndex | ( | ) |
Get the event index EN# field
| unsigned int Message::getEventNumber | ( | ) |
Get the event number
| byte Message::getEventVar | ( | ) |
Get the event variable EV field
| byte Message::getEventVarIndex | ( | ) |
Get the event variable index EV# field
| byte Message::getFunctionNumber | ( | ) |
Get the function number Fn for DCC messages
| byte Message::getMessageSize | ( | ) |
Get the CBUS message size. Extract it from the opc.
| unsigned int Message::getNodeNumber | ( | ) |
Get the node number
| byte Message::getNodeVariable | ( | ) |
Get the node variable NV field
| byte Message::getNodeVariableIndex | ( | ) |
Get the node variable index NV# field
| byte Message::getOpc | ( | ) |
first byte contains the opc and the number of bytes in the message the first 3 bits are the number of bytes the 5 last bits are the OPC
| byte Message::getParaIndex | ( | ) |
Get the parameter index Para# field
| byte Message::getParameter | ( | ) |
Get the parameter Para field
| byte Message::getSession | ( | ) |
Get the loc session for DCC messages
| byte Message::getSpeedDir | ( | ) |
Get the speed direction for DCC messages
| byte Message::getStatus | ( | ) |
Get the status field
| byte Message::getStoredEvents | ( | ) |
Get the amount of stored events
| bool Message::isAccOff | ( | ) |
Check the if it is an OFF message. Major event in CBUS.
| bool Message::isAccOn | ( | ) |
Check the if it is an ON message. Major event in CBUS.
| bool Message::isLongEvent | ( | ) |
Check the if it is an OFF message. Major event in CBUS.
| bool Message::isShortEvent | ( | ) |
Check the if it is an ON message. Major event in CBUS.
| void Message::setDataBuffer | ( | byte | val[CANDATA_SIZE] | ) |
Set the can buffer.
| val | A 8 bytes array. |
| void Message::setHeaderBuffer | ( | byte | val[HEADER_SIZE] | ) |
Set the header buffer.
| val | A 8 bytes array. |