class documentation

DCC Speed Command Packet

Speed commands are built for specific DCC addresses and are retained on the packet list for periodic transmission. The speed and direction may be updated and this will rebuild the packet, recalculating the checksum.

Method __init__ Construct a speed command
Method update Update Speed Command
Constant TYPE S - Speed Command Packet
Instance Variable _address Undocumented
Instance Variable _byte_list Undocumented
Instance Variable _type Undocumented

Inherited from CommandPacket:

Method is_locked Is Locked
Method set_buffer Set buffer contents
Constant BASE_LONG_ADDR DCC long mobile address range base
Constant MAX_LONG_ADDR DCC long address upper limit (inclusive)
Constant MIN_LONG_ADDR DCC long address lower limit (inclusive)
Instance Variable NOT_SENT Return value for command not sent (command being updated)
Instance Variable SENT Return value for command serialised
Instance Variable SENT_POM Return valued for Program on Main second send
Property address Get Address
Property packet_buffer Get the Packet Buffer
Property type Get the command type
Instance Variable _packet_buff Undocumented
def __init__(self, address, dir, speed):

Construct a speed command

This constructs a speed command. It calls __init__ in the base class. It sets the type, address, direction and speed. Direction and speed may be updated later.

Note

Parameters not validated here.

Parameters
addressDCC address of target decoder
dirDirection (1:forward or 0:reverse)
speedSpeed
def update(self, dir, speed):

Update Speed Command

This updates the speed command. Speed and direction may be changed.

Note

Parameters not validated here.

Parameters
dirNew direction (forward or reverse)
speedNew speed
TYPE: str =

S - Speed Command Packet

Value
'S'
_address =

Undocumented

_byte_list =

Undocumented

_type =

Undocumented