Interface IProgrammingControl
- Namespace
- CommandStation
- Assembly
- CommandStation.Abstractions.dll
Reading and writing decoder configuration variables (CVs) in direct mode on the programming track. CV addresses are 0-based (0 = CV1).
public interface IProgrammingControl
Methods
ReadCvAsync(ushort)
Task ReadCvAsync(ushort cvAddress)
Parameters
cvAddressushort
Returns
ReadCvAsync(ushort, TimeSpan)
Reads a CV on the programming track, retrying while the decoder does not acknowledge, and returns the value. A missing acknowledgement that never clears (for example an absent or unreadable decoder) is reported as a timeout rather than a distinct error. Do not call the fire-and-forget CV methods concurrently with this one on the same station.
Task<byte> ReadCvAsync(ushort cvAddress, TimeSpan timeout)
Parameters
Returns
Exceptions
- CvOperationTimeoutException
No result arrived within
timeout.- CvShortCircuitException
The command station reported a short circuit.
- ArgumentOutOfRangeException
timeoutis not a positive, in-range duration.
WriteCvAsync(ushort, byte)
Task WriteCvAsync(ushort cvAddress, byte value)
Parameters
Returns
WriteCvAsync(ushort, byte, TimeSpan)
Writes a CV on the programming track, retrying while the decoder does not acknowledge, and
completes once the command station acknowledges the write (LAN_X_CV_RESULT). A missing
acknowledgement that never clears is reported as a timeout. Do not call the fire-and-forget CV
methods concurrently with this one on the same station.
Task WriteCvAsync(ushort cvAddress, byte value, TimeSpan timeout)
Parameters
Returns
Exceptions
- CvOperationTimeoutException
The write was not acknowledged within
timeout.- CvShortCircuitException
The command station reported a short circuit.
- ArgumentOutOfRangeException
timeoutis not a positive, in-range duration.
Events
CvProgrammingFailed
event EventHandler<CvProgrammingError>? CvProgrammingFailed
Event Type
CvReadCompleted
event EventHandler<CvValue>? CvReadCompleted