Model Railroad System  2.2.2
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lcc::CanMessage Class Reference

A CAN Message, containing a 29-bit header and upto 8 bytes of data. More...

Public Member Functions

 CanMessage (name,...)
 Constructor: create a CANMessage object Creates a fresh CANMessage object, with possible initialization. More...
 
 hashCode ()
 Return a hash code. More...
 
 equals (a)
 Equality check. More...
 
 replyExpected ()
 Reply expected. More...
 
 setNumDataElements (n)
 Set the number of data elements. More...
 
 setData (d)
 Set the data values. More...
 
 getData ()
 Return the data vector. More...
 
 getHeader ()
 Return the header. More...
 
 setHeader (h)
 Set the header. More...
 
 toString ()
 Method to create a string version of the message. More...
 

Static Public Member Functions

static copy (m)
 Copy constructor. More...
 
static validate (o)
 Validator typemethod. More...
 

Public Attributes

 _header
 The header. More...
 

Detailed Description

A CAN Message, containing a 29-bit header and upto 8 bytes of data.

Options:

Constructor & Destructor Documentation

◆ CanMessage()

lcc::CanMessage::CanMessage ( name  ,
  ... 
)

Constructor: create a CANMessage object Creates a fresh CANMessage object, with possible initialization.

Parameters
nameThe name of the new instance.
...The options:
  • -header The 29-bit header. Readonly, used only during creation.
  • -length The length of the data. Readonly, used only during creation.
  • -data The initial data. Readonly, used only during creation.
  • -extended. Boolean flag to indicate an extended protocol frame.
  • -rtr. Boolean flag to indicate if a reply is expected.

Member Function Documentation

◆ copy()

static lcc::CanMessage::copy ( )
static

Copy constructor.

Copies a CANMessage instance.

Parameters
mThe CANMessage to make a copy of.

◆ equals()

lcc::CanMessage::equals ( )

Equality check.

CANMessages are equal if all of the bits are the same.

Parameters
aA CANMessage to compare to.
Returns
A boolean value indication equality.

◆ getData()

lcc::CanMessage::getData ( )

Return the data vector.

Returns
The data vector.

◆ getHeader()

lcc::CanMessage::getHeader ( )

Return the header.

Returns
The header.

◆ hashCode()

lcc::CanMessage::hashCode ( )

Return a hash code.

Returns
The header as the object's hash code.

◆ replyExpected()

lcc::CanMessage::replyExpected ( )

Reply expected.

Returns
A boolean flag indicating if a reply is expected.

◆ setData()

lcc::CanMessage::setData ( )

Set the data values.

Copy data into the data vector.

Parameters
dReplacement data values.

◆ setHeader()

lcc::CanMessage::setHeader ( )

Set the header.

Parameters
hThe new header.

◆ setNumDataElements()

lcc::CanMessage::setNumDataElements ( )

Set the number of data elements.

Sets the number of data elements.

Parameters
nThe number of data elements.

◆ toString()

lcc::CanMessage::toString ( )

Method to create a string version of the message.

Returns
A string representation of the message.

◆ validate()

static lcc::CanMessage::validate ( )
static

Validator typemethod.

Parameters
oThe object to validate.

Member Data Documentation

◆ _header

lcc::CanMessage::_header

The header.