Expand description
This module provides types and serialisers for each “baseline” packet type defined by the NMRA standard.
Structs§
- Broadcast
Stop - Instruct all decoders to stop, either immediately or by simply removing motor power (“float”). The specification allows a direction field, but that is not implemented here because in situations where a BroadcastStop is being sent it is unlikely that direction settings will be important. (whereas a regular stop might wish to retain headlight states)
- Idle
- An Idle packet is one in which the address is 0xff and instruction 0x00. Upon receiving this, a decoder performs no new action.
- Reset
- A Reset packet is one in which the address, instruction, and ECC are all zero. All decoders will, upon receiving this packet, reset to their normal power-up state. Any speed or direction will be cleared and locomotives stopped.
- Speed
AndDirection - Speed and Direction packet. Used to command a loco to move in the given direction at the given speed.
- Speed
AndDirection Builder - Builder used to construct a SpeedAndDirection packet
Enums§
- Direction
- Possible directions, usually referenced to the “forward” direction of a loco