-
Notifications
You must be signed in to change notification settings - Fork 8
Station Controller API
Status info about a segment if it is enabled or disabled.
Segment State changed messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: segment/state
{"segmentID":01,"state":0} //disabled
{"segmentID":01,"state":1} //enabled
In addition, to extend basic functionality, you can request manually to get Segment State current state.
Just send:
Topic: segment/state
{"segmentID":01,"getstate":"one"} //for one segment
{"getstate":"every"} //for every segments
Status info about a turnout’s reference state, if it is straight or divergent.
Turnout State changed messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: turnout/state
{"turnoutID":01,"state":"straight"}
{"turnoutID":01,"state":"divergent"}
In addition, to extend basic functionality, you can request manually to get Turnout State current state.
Just send:
Topic: turnout/state
{"turnoutID":01,"getstate":"one"} //for one state
{"getstate":"every"} //for every states
Status info about which segment has train on it.
Segment Occupancy messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: segment/occupancy
{"segmentID":01,"occupancy":"occupied"}
{"segmentID":01,"occupancy":"free"}
In addition, to extend basic functionality, you can request manually to get Occupancy.
Just send:
Topic: segment/occupancy
{"segmentID":01,"getoccupancy":"one"} //for one segment
{"getoccupancy":"every"} //for every segment
Change Segment State to enabled or disabled.
Topic: command/segment
{"segmentID":01,"state":0} //disabled
{"segmentID":01,"state":1} //enabled
Change every Segment State to enabled or disabled.
Topic: command/segment
{"stateAll":0} //disabled
{"stateAll":1} //enabled
Change Turnout State to straight or divergent.
Topic: command/turnout
{"turnoutID":01,"state":"straight"}
{"turnoutID":01,"state":"divergent"}