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

A Grid Connect formatted CAN message (reply). More...

Public Member Functions

 GridConnectReply (name,...)
 Constructor: create a GridConnectReply instance. More...
 
 createReply ()
 Convert to a binary CanMessage object. More...
 
 setElement (n, v)
 Set the element. More...
 
 maxSize ()
 Return the maximum size of a Grid Connect Message. More...
 
 setData (d)
 Set the data Copy the data bytes into the structure. More...
 
 getHeader ()
 Extract the header as a 29-bit integer. More...
 
 getNumBytes ()
 Return the number of data bytes. More...
 
 getByte (b)
 Return a selected data byte. More...
 
 getHexDigit (index)
 Get one hexadecimal digit. More...
 

Private Member Functions

 _get_extended (opt)
 CGet method for the -extended option. More...
 
 _get_rtr (opt)
 CGet method for the -rtr option. More...
 
 _copyGCM (option, s)
 Configure method for the -message option. More...
 
 basicFormatCheck ()
 Perform a basic format check. More...
 

Private Attributes

 _RTRoffset
 The offset to the RTR flag. More...
 

Static Private Attributes

static MAXLEN
 The maximum length for a Grid Connect Message. More...
 

Detailed Description

A Grid Connect formatted CAN message (reply).

This is an ASCII formatted version of a CAN message, used by some USB connected CAN interface devices.

This class is used to convert to binary CAN Messages from ASCII Grid Connect messages. See GridConnectMessage for converting to ASCII Grid Connect messages from binary CAN Messages.

Options:

Constructor & Destructor Documentation

◆ GridConnectReply()

lcc::GridConnectReply::GridConnectReply ( name  ,
  ... 
)

Constructor: create a GridConnectReply instance.

A GridConnectReply object is created.

Parameters
nameThe name of the new instance.
...The options:
  • -message An optional Grid Connect Message string.

Member Function Documentation

◆ _copyGCM()

lcc::GridConnectReply::_copyGCM ( option  ,
 
)
private

Configure method for the -message option.

Send in an ASCII Grid Connect Message for conversion.

Parameters
optionAllways -message. Ignored.
sThe ASCII Grid Connect Message as a string.

◆ _get_extended()

lcc::GridConnectReply::_get_extended ( opt  )
private

CGet method for the -extended option.

Gets the extended protocol flag for this message.

Parameters
optAllways -extended. Ignored.
Returns
The extended protocol flag for this message.

◆ _get_rtr()

lcc::GridConnectReply::_get_rtr ( opt  )
private

CGet method for the -rtr option.

Gets the reply flag for this message.

Parameters
optAllways -rtr. Ignored.
Returns
The reply flag for this message.

◆ basicFormatCheck()

lcc::GridConnectReply::basicFormatCheck ( )
private

Perform a basic format check.

Check for a basicly correct formatted string.

Returns
A boolean flag indicating that the message passed a basic format check.

References i.

◆ createReply()

lcc::GridConnectReply::createReply ( )

Convert to a binary CanMessage object.

Decode a Grid Connect Message into a binary CanMessage object.

Returns
A CanMessage object.

◆ getByte()

lcc::GridConnectReply::getByte ( )

Return a selected data byte.

Parameters
bThe index of the byte (0-7) to return.
Returns
The data bytes or 0.

◆ getHeader()

lcc::GridConnectReply::getHeader ( )

Extract the header as a 29-bit integer.

Peel the hexadecimal digits between the simple/extended flag character and the reply/noreply character as a 29-bit CAN header word.

Returns
A 29-bit integer.

◆ getHexDigit()

lcc::GridConnectReply::getHexDigit ( index  )

Get one hexadecimal digit.

Parameters
indexThe low-level data index of the nibble to return.
Returns
The nibble.

◆ getNumBytes()

lcc::GridConnectReply::getNumBytes ( )

Return the number of data bytes.

Returns
The number of data bytes.

◆ maxSize()

lcc::GridConnectReply::maxSize ( )

Return the maximum size of a Grid Connect Message.

Returns
The maximum size of a Grid Connect Message.

◆ setData()

lcc::GridConnectReply::setData ( )

Set the data Copy the data bytes into the structure.

Parameters
dA list of data bytes (characters).

◆ setElement()

lcc::GridConnectReply::setElement ( ,
 
)

Set the element.

Set the element at the specified index.

Parameters
nThe index to set.
vThe value to set.

Member Data Documentation

◆ _RTRoffset

lcc::GridConnectReply::_RTRoffset
private

The offset to the RTR flag.

◆ MAXLEN

lcc::GridConnectReply::MAXLEN
staticprivate

The maximum length for a Grid Connect Message.