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

MTI Header type, detailed version. More...

Public Member Functions

 MTIDetail (name,...)
 Constructor: create a MTIDetail object. More...
 
 getHeader (CANp=1)
 Get the 29-bit CAN header or 16-bit MTI. More...
 
 setHeader (header)
 Decode the 29-bit header. More...
 

Private Attributes

 mtiheader
 the MTIHeader component. More...
 

Static Private Attributes

static SPECIAL_MASK
 The Special bit is bit 13. More...
 
static STREAMDG_MASK
 The Stream or Datagram bit is bit 12. More...
 
static PRIORITY_SHIFT
 The priority is bits 10-11 of the MTI_CAN. More...
 
static PRIORITY_MASK
 The priority is bits 10-11 of the MTI_CAN. More...
 
static TYPEWITHIN_SHIFT
 The type within priority field is bits 5-9 of the MTI_CAN. More...
 
static TYPEWITHIN_MASK
 The type within priority field is bits 5-9 of the MTI_CAN. More...
 
static SIMPLE_SHIFT
 The simple bit is bit 4 of the MTI_CAN. More...
 
static SIMPLE_MASK
 The simple bit is bit 4 of the MTI_CAN. More...
 
static ADDRESSP_SHIFT
 The address present bit is bit 3 of the MTI_CAN. More...
 
static ADDRESSP_MASK
 The address present bit is bit 3 of the MTI_CAN. More...
 
static EVENTP_SHIFT
 The event present bit is bit 2 of the MTI_CAN. More...
 
static EVENTP_MASK
 The event present bit is bit 2 of the MTI_CAN. More...
 
static MODIFIER_SHIFT
 The modifier is bits 0-1 of the MTI_CAN. More...
 
static MODIFIER_MASK
 The modifier is bits 0-1 of the MTI_CAN. More...
 
static DESTID_SHIFT
 The destid is bits 0-11 of the MTI_CAN. More...
 
static DESTID_MASK
 The destid is bits 0-11 of the MTI_CAN. More...
 

Detailed Description

MTI Header type, detailed version.

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

◆ MTIDetail()

lcc::MTIDetail::MTIDetail ( name  ,
  ... 
)

Constructor: create a MTIDetail object.

A 29-bit CAN Header specific to the OpenLCB is created, using details for a MTI frame.

Parameters
nameThe name of the instance.
...Options:
  • -srcid A 12 bit source id field.
  • -special A boolean flag indicating if this is a special frame.
  • -streamordatagram A boolean flag indicating if this is a stream or datagram frame.
  • -priority A 2-bit integer specifying the frame's priority.
  • -typewithin A 5-bit integer specifying the type withing the
  • -simple A boolean flag indicating if the frame is a simple protocol frame.
  • -addressp A boolean flag indicating if an address is present.
  • -eventp A boolean flag indicating if an event is present.
  • -modifier The 2-bit modifier field.
  • -destid A 12-bit Desitination alias. Only used for stream and datagram frames.
  • -datagramcontent An enumerated type defining the datagram or stream content type.

Member Function Documentation

◆ getHeader()

lcc::MTIDetail::getHeader ( CANp  = 1)

Get the 29-bit CAN header or 16-bit MTI.

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

See also
lcc::CANHeader and lcc::MTIHeader.
Parameters
CANpSpecify whether we want a 29-bit CAN header or a 16-bit MTI.
Returns
The 29-bit CAN header or 16-bit MTI.

◆ setHeader()

lcc::MTIDetail::setHeader ( header  )

Decode the 29-bit header.

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

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

Member Data Documentation

◆ ADDRESSP_MASK

lcc::MTIDetail::ADDRESSP_MASK
staticprivate

The address present bit is bit 3 of the MTI_CAN.

◆ ADDRESSP_SHIFT

lcc::MTIDetail::ADDRESSP_SHIFT
staticprivate

The address present bit is bit 3 of the MTI_CAN.

◆ DESTID_MASK

lcc::MTIDetail::DESTID_MASK
staticprivate

The destid is bits 0-11 of the MTI_CAN.

◆ DESTID_SHIFT

lcc::MTIDetail::DESTID_SHIFT
staticprivate

The destid is bits 0-11 of the MTI_CAN.

◆ EVENTP_MASK

lcc::MTIDetail::EVENTP_MASK
staticprivate

The event present bit is bit 2 of the MTI_CAN.

◆ EVENTP_SHIFT

lcc::MTIDetail::EVENTP_SHIFT
staticprivate

The event present bit is bit 2 of the MTI_CAN.

◆ MODIFIER_MASK

lcc::MTIDetail::MODIFIER_MASK
staticprivate

The modifier is bits 0-1 of the MTI_CAN.

◆ MODIFIER_SHIFT

lcc::MTIDetail::MODIFIER_SHIFT
staticprivate

The modifier is bits 0-1 of the MTI_CAN.

◆ mtiheader

lcc::MTIDetail::mtiheader
private

the MTIHeader component.

Contains a MTIHeader to perform heavy lifting.

◆ PRIORITY_MASK

lcc::MTIDetail::PRIORITY_MASK
staticprivate

The priority is bits 10-11 of the MTI_CAN.

◆ PRIORITY_SHIFT

lcc::MTIDetail::PRIORITY_SHIFT
staticprivate

The priority is bits 10-11 of the MTI_CAN.

◆ SIMPLE_MASK

lcc::MTIDetail::SIMPLE_MASK
staticprivate

The simple bit is bit 4 of the MTI_CAN.

◆ SIMPLE_SHIFT

lcc::MTIDetail::SIMPLE_SHIFT
staticprivate

The simple bit is bit 4 of the MTI_CAN.

◆ SPECIAL_MASK

lcc::MTIDetail::SPECIAL_MASK
staticprivate

The Special bit is bit 13.

◆ STREAMDG_MASK

lcc::MTIDetail::STREAMDG_MASK
staticprivate

The Stream or Datagram bit is bit 12.

◆ TYPEWITHIN_MASK

lcc::MTIDetail::TYPEWITHIN_MASK
staticprivate

The type within priority field is bits 5-9 of the MTI_CAN.

◆ TYPEWITHIN_SHIFT

lcc::MTIDetail::TYPEWITHIN_SHIFT
staticprivate

The type within priority field is bits 5-9 of the MTI_CAN.