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

MTI Header type. More...

Public Member Functions

 MTIHeader (name,...)
 Constructor: create a MTIHeader A 29-bit CAN Header specific to the OpenLCB is created. More...
 
 getHeader ()
 Get the 29-bit header. More...
 
 setHeader (header)
 Decode the 29-bit header. More...
 

Private Attributes

 canheader
 The CANHeader component. More...
 

Static Private Attributes

static MTI_CAN_SHIFT
 Bits 0-11 of the variable field are the MTI_CAN field. More...
 
static MTI_CAN_MASK
 Bits 0-11 of the variable field are the MTI_CAN field. More...
 
static FRAMETYPE_SHIFT
 Bits 12-14 of the variable field are the frame type field. More...
 
static FRAMETYPE_MASK
 Bits 12-14 of the variable field are the frame type field. More...
 

Detailed Description

MTI Header type.

Creates a 29-bit CAN header, specific to OpenLCB. The header is generated and decoded `‘on the fly’' from/to the supplied options:

Constructor & Destructor Documentation

◆ MTIHeader()

lcc::MTIHeader::MTIHeader ( name  ,
  ... 
)

Constructor: create a MTIHeader A 29-bit CAN Header specific to the OpenLCB is created.

Parameters
nameThe name of the instance.
...Options:
  • -srcid A 12 bit source id field.
  • -mti The 12 bit CAN_MTI field.
  • -frametype The three bit frame type field.

Member Function Documentation

◆ getHeader()

lcc::MTIHeader::getHeader ( )

Get the 29-bit header.

Most of the heavy lifting is handled in the canheader component.

See also
lcc::CANHeader.
Returns
The 29-bit header.

◆ setHeader()

lcc::MTIHeader::setHeader ( header  )

Decode the 29-bit header.

Most of the heavy lifting is handled in the canheader component.

See also
lcc::CANHeader.
Parameters
headerThe 29-bit header.

Member Data Documentation

◆ canheader

lcc::MTIHeader::canheader
private

The CANHeader component.

Handles the header at the CAN level.

◆ FRAMETYPE_MASK

lcc::MTIHeader::FRAMETYPE_MASK
staticprivate

Bits 12-14 of the variable field are the frame type field.

◆ FRAMETYPE_SHIFT

lcc::MTIHeader::FRAMETYPE_SHIFT
staticprivate

Bits 12-14 of the variable field are the frame type field.

◆ MTI_CAN_MASK

lcc::MTIHeader::MTI_CAN_MASK
staticprivate

Bits 0-11 of the variable field are the MTI_CAN field.

◆ MTI_CAN_SHIFT

lcc::MTIHeader::MTI_CAN_SHIFT
staticprivate

Bits 0-11 of the variable field are the MTI_CAN field.