Skip to content

Station Controller API

jeno96 edited this page Dec 23, 2018 · 31 revisions

Messages

Status Messages

Segment State

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 state
{"getstate":"every"}               //for every states

Turnout State

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

Clone this wiki locally