|
Open Model Railroad Network (OpenMRN)
|
Default implementation of the storage and policy module for trains. More...
#include <LogonModule.hxx>
Classes | |
| struct | LocoInfo |
| We store this structure about each locomotive. More... | |
Public Member Functions | |
| unsigned | num_locos () |
| bool | is_valid_loco_id (unsigned loco_id) |
| uint8_t & | loco_flags (unsigned loco_id) |
| Finds the storage cell for a locomotive and returns the flag byte for it. | |
| uint64_t | loco_did (unsigned loco_id) |
| Retrieves the decoder unique ID. | |
| unsigned | create_or_lookup_loco (uint64_t decoder_id) |
| Creates a new locomotive by decoder ID, or looks up an existing locomotive by decoder ID. | |
| void | run_address_policy (unsigned loco_id, uint16_t desired_address) |
| Runs the locomotive address policy. | |
| uint16_t | assigned_address (unsigned loco_id) |
| void | assign_complete (unsigned loco_id) |
| Invoked when the address assignment completes for a decoder. | |
Public Member Functions inherited from dcc::LogonHandlerModule | |
| unsigned | num_locos () |
| bool | is_valid_loco_id (unsigned loco_id) |
| uint8_t & | loco_flags (unsigned loco_id) |
| Finds the storage cell for a locomotive and returns the flag byte for it. | |
| uint64_t | loco_did (unsigned loco_id) |
| Retrieves the decoder unique ID. | |
| unsigned | create_or_lookup_loco (uint64_t decoder_id) |
| Creates a new locomotive by decoder ID, or looks up an existing locomotive by decoder ID. | |
| void | run_address_policy (unsigned loco_id, uint16_t desired_address) |
| Runs the locomotive address policy. | |
| uint16_t | assigned_address (unsigned loco_id) |
| void | assign_complete (unsigned loco_id) |
| Invoked when the address assignment completes for a decoder. | |
Public Attributes | |
| std::vector< LocoInfo > | locos_ |
| std::map< uint64_t, uint16_t > | ids_ |
| uint16_t | nextAddress_ {(Defs::ADR_MOBILE_LONG << 8) + 10000} |
Additional Inherited Members | |
Public Types inherited from dcc::LogonHandlerModule | |
| enum | Flags { FLAG_NEEDS_GET_SHORTINFO = 0x01 , FLAG_PENDING_GET_SHORTINFO = 0x02 , FLAG_NEEDS_ASSIGN = 0x04 , FLAG_PENDING_ASSIGN = 0x08 , FLAG_COMPLETE = 0x10 , FLAG_ERROR_STATE = 0x20 , FLAG_PENDING_RETRY = 0x40 , FLAG_PENDING_TICK = 0x80 } |
| Flags for the logon handler module. More... | |
Default implementation of the storage and policy module for trains.
Definition at line 48 of file LogonModule.hxx.
|
inline |
Invoked when the address assignment completes for a decoder.
| loco_id | which decoder. |
Definition at line 146 of file LogonModule.hxx.
|
inline |
| loco_id |
Definition at line 139 of file LogonModule.hxx.
|
inline |
Creates a new locomotive by decoder ID, or looks up an existing locomotive by decoder ID.
| decoder_id | 44-bit decoder ID (aligned to LSb). |
Definition at line 104 of file LogonModule.hxx.
|
inline |
| loco_id | a locomotive identifier |
Definition at line 78 of file LogonModule.hxx.
|
inline |
Retrieves the decoder unique ID.
| loco_id | the dense locomotive identifier. |
Definition at line 95 of file LogonModule.hxx.
|
inline |
Finds the storage cell for a locomotive and returns the flag byte for it.
| loco_id | a valid locomotive ID. |
Definition at line 87 of file LogonModule.hxx.
|
inline |
Definition at line 71 of file LogonModule.hxx.
|
inline |
Runs the locomotive address policy.
After the address policy is run, the loco should have the ability to answer the assigned_address question.
| loco_id | which locomotive this is |
| desired_address | the S-9.2.1.1 encoded desired address for this decoder. |
Definition at line 128 of file LogonModule.hxx.
| std::map<uint64_t, uint16_t> dcc::ParameterizedLogonModule< Base >::ids_ |
Definition at line 67 of file LogonModule.hxx.
| std::vector<LocoInfo> dcc::ParameterizedLogonModule< Base >::locos_ |
Definition at line 66 of file LogonModule.hxx.
| uint16_t dcc::ParameterizedLogonModule< Base >::nextAddress_ {(Defs::ADR_MOBILE_LONG << 8) + 10000} |
Definition at line 151 of file LogonModule.hxx.