class CV_Access(CommandPacket):
Constructor: CV_Access(address, cv, operation, value)
CV access - POM
This is the CV Access Command - long form RCN-214 Section 2. Only one CV access conversation may take place concurrently. RailCom only - not service track or simplex Programming on Main.
To read a single CV we can execute either of the check operations. In RailCom POM these both return the entire CV rather than the simple boolean service mode response. In practice we will use byte check for cv read.
Objects in this class are single use. I.e once the CV access is complete they may dropped for garbage collection.
TODO Do we need to look at accessory CVs too?
| Method | __init__ |
Construct a Program on Main Command |
| Method | all |
Update State after Send |
| Method | get |
Get the CV number |
| Method | get |
Get the command state |
| Constant | BIT |
CV BIT Check |
| Constant | BIT |
As specified in RCN-217 for write cv bit |
| Constant | BIT |
CV Bit Write |
| Constant | BYTE |
As specified in RCN-217 for read cv byte |
| Constant | BYTE |
As specified in RCN-217 for write cv byte |
| Constant | NOT |
Undocumented |
| Constant | SENT |
Undocumented |
| Constant | SENT |
Undocumented |
| Constant | TYPE |
P - Programme on Main |
| Constant | _CMD |
Undocumented |
| Instance Variable | _address |
Undocumented |
| Instance Variable | _byte |
Undocumented |
| Instance Variable | _cv |
Undocumented |
| Instance Variable | _operation |
Undocumented |
| Instance Variable | _state |
Undocumented |
| Instance Variable | _type |
Undocumented |
Inherited from CommandPacket:
| Method | is |
Is Locked |
| Method | set |
Set buffer contents |
| Constant | BASE |
DCC long mobile address range base |
| Constant | MAX |
DCC long address upper limit (inclusive) |
| Constant | MIN |
DCC long address lower limit (inclusive) |
| Instance Variable | SENT |
Return value for command serialised |
| Property | address |
Get Address |
| Property | packet |
Get the Packet Buffer |
| Property | type |
Get the command type |
| Instance Variable | _packet |
Undocumented |
Construct a Program on Main Command
This constructs a POM command. It calls __init__ in the base class. It sets the decoder address, the CV number, the operation (read or write), and the new value. At the moment only single byte CV operations are supported.
Note
Parameters not validated here.
| Parameters | |
| address | DCC address of target decoder |
| cv | CV number to read or write |
| operation | read(r) or write(w) |
| value | new value for CV |
Update State after Send
Process state according to operation (r or w)
Should only need to send read once but TOM appears to need it twice!
returns True if all POM sends done
Get the CV number
This returns the number of the CV being accessed. The primary purpose is allow the Channel 2 response processor to determine which CV a returned CV value relates to.
| Returns | |
| The CV numver being accessed. |