class documentation
Cab Agent
This agent's subscription is used to handle publications to the cab topic. It is not used to publish a cab message, but to handle the cab message when it is received from the broker.
Cab commands are passed to the DCC system for encodeing and transmission.
This is a singleton and receives all cab messages. Singularity is not enforced.
A valid DCC speed command requires both direction and speed, but these are in separate MQTT publications. DCC speed commands are not issued until valid MQTT publicatons have been received for both speed and direction.
| Method | __init__ |
Initialise the cab subscription |
| Method | handle |
Handle a publication This method is called by the MQTT client when a publication is received. |
| Constant | DIR |
Direction decode for decoder direction commands |
| Method | _create |
Overrides version in base class |
| Method | _handle |
Undocumented |
| Method | _handle |
Undocumented |
| Method | _handle |
Undocumented |
| Method | _handle |
Undocumented |
| Async Method | _pub |
Check for publication. |
| Constant | _CAB |
Undocumented |
| Class Variable | _cab |
Undocumented |
| Instance Variable | _dcc |
Undocumented |
| Instance Variable | _rc2 |
Undocumented |
Initialise the cab subscription
| Parameters | |
| topic | the topic filter to match against received topics |
| qos | the Quality of Service for this subscription. Must be either MQTTClient.QOS0 or MQTTClient.QOS1 |
Handle a publication This method is called by the MQTT client when a publication is received.
| Parameters | |
| topic | the topic of the publication |
| dup | True if this is a duplicate publication |
| ret | True if this is a retained publication |
| payload | the payload of the publication as a string |
DIR_DECODE =
¶
Direction decode for decoder direction commands
| Value |
|
_CAB_CMD =
¶
Undocumented
| Value |
|