Special constant values returned by the railcom_decode[] array.
More...
#include <RailCom.hxx>
|
| static uint16_t | encode12 (uint8_t nibble, uint8_t data) |
| | Encodes 12 bits of useful payload into 16 bits of UART data to transmit.
|
| |
| static void | append12 (uint8_t nibble, uint8_t data, uint8_t *dst) |
| | Encodes 12 bits of useful payload into 16 bits of UART data to transmit.
|
| |
| static void | append36 (uint8_t nibble, uint32_t data, uint8_t *dst) |
| | Encodes a 36-bit railcom datagram into UART bytes.
|
| |
| static void | add_did_feedback (uint64_t decoder_id, Feedback *fb) |
| | Creates a Logon Enable feedback with the decoder unique ID.
|
| |
| static void | add_shortinfo_feedback (uint16_t requested_address, uint8_t max_fn, uint8_t psupp, uint8_t ssupp, Feedback *fb) |
| | Creates a ShortInfo feedback.
|
| |
| static void | add_assign_feedback (uint8_t changeflags, uint16_t changecount, uint8_t supp2, uint8_t supp3, Feedback *fb) |
| | Creates a Logon Assign feedback.
|
| |
|
|
| RailcomDefs () |
| | This struct cannot be instantiated.
|
| |
Special constant values returned by the railcom_decode[] array.
Definition at line 94 of file RailCom.hxx.
◆ anonymous enum
| Enumerator |
|---|
| INV | invalid value (not conforming to the 4bit weighting requirement)
|
| ACK | Railcom ACK; the decoder received the message ok.
NOTE: There are two codepoints that map to this.
|
| NACK | The decoder rejected the packet.
|
| BUSY | The decoder is busy; send the packet again.
This is typically returned when a POM CV write is still pending; the caller must re-try sending the packet later.
|
| RESVD1 | Reserved for future expansion.
|
| RESVD2 | Reserved for future expansion.
|
Definition at line 97 of file RailCom.hxx.
◆ anonymous enum
| Enumerator |
|---|
| CODE_ACK | Code point for ACK (according to RCN-217)
|
| CODE_ACK2 | Another accepted code point for ACK (according to RCN-217)
|
| CODE_NACK | Code point for NACK (according to RCN-217)
|
| CODE_BUSY | Code point for BUSY (according to NMRA S-9.3.2)
|
Definition at line 118 of file RailCom.hxx.
◆ add_assign_feedback()
| void dcc::RailcomDefs::add_assign_feedback |
( |
uint8_t |
changeflags, |
|
|
uint16_t |
changecount, |
|
|
uint8_t |
supp2, |
|
|
uint8_t |
supp3, |
|
|
Feedback * |
fb |
|
) |
| |
|
static |
Creates a Logon Assign feedback.
- Parameters
-
| changeflags | 8 bits of change flags |
| changecount | 12 bits of changecount |
| supp2 | protocol support flags (capabilities[2]) |
| supp3 | protocol support flags (capabilities[3]) |
| fb | the feedback packet to generate. |
Definition at line 336 of file RailCom.cxx.
◆ add_did_feedback()
| void dcc::RailcomDefs::add_did_feedback |
( |
uint64_t |
decoder_id, |
|
|
Feedback * |
fb |
|
) |
| |
|
static |
Creates a Logon Enable feedback with the decoder unique ID.
- Parameters
-
| decoder_id | the 44-bit decoder ID (justified to MSb). |
| fb | the feedback packet to generate. |
Definition at line 305 of file RailCom.cxx.
◆ add_shortinfo_feedback()
| void dcc::RailcomDefs::add_shortinfo_feedback |
( |
uint16_t |
requested_address, |
|
|
uint8_t |
max_fn, |
|
|
uint8_t |
psupp, |
|
|
uint8_t |
ssupp, |
|
|
Feedback * |
fb |
|
) |
| |
|
static |
Creates a ShortInfo feedback.
- Parameters
-
| requested_address | 14-bit encoding of the requested address. |
| max_fn | maximum supported function (0-255) |
| psupp | protocol support flags (capabilities[0]) |
| ssupp | space support flags (capabilities[1]) |
| fb | the feedback packet to generate. |
Definition at line 315 of file RailCom.cxx.
◆ append12()
| static void dcc::RailcomDefs::append12 |
( |
uint8_t |
nibble, |
|
|
uint8_t |
data, |
|
|
uint8_t * |
dst |
|
) |
| |
|
inlinestatic |
Encodes 12 bits of useful payload into 16 bits of UART data to transmit.
- Parameters
-
| nibble | top 4 bits of the payload to send |
| data | bottom 8 bits of payload to send. |
| dst | this is where the payload will be stored. |
Definition at line 145 of file RailCom.hxx.
◆ append36()
| static void dcc::RailcomDefs::append36 |
( |
uint8_t |
nibble, |
|
|
uint32_t |
data, |
|
|
uint8_t * |
dst |
|
) |
| |
|
inlinestatic |
Encodes a 36-bit railcom datagram into UART bytes.
- Parameters
-
| nibble | the railcom ID (top 4 bits) |
| data | the 32 bit payload. Will be transmitted MSbyte-first. |
| dst | this is where the payload will be stored. |
Definition at line 155 of file RailCom.hxx.
◆ encode12()
| static uint16_t dcc::RailcomDefs::encode12 |
( |
uint8_t |
nibble, |
|
|
uint8_t |
data |
|
) |
| |
|
inlinestatic |
Encodes 12 bits of useful payload into 16 bits of UART data to transmit.
- Parameters
-
| nibble | top 4 bits of the payload to send |
| data | bottom 8 bits of payload to send. |
- Returns
- the uart bytes, first byte in the high 8 bits, second byte in the low 8 bits.
Definition at line 135 of file RailCom.hxx.
The documentation for this struct was generated from the following files: