Layout Control System (LCS)
|
Macros | |
#define | TRN_STATUS 1 |
#define | BLK_STATUS 2 |
#define | DEVICE_STATUS 3 |
#define | END_STATUS_MESSAGES 5 |
#define | TRN_ACTIVATE 6 |
#define | TRN_ACTIVATE_ROUTE 7 |
#define | SYS_ACK 10 |
#define | SYS_CONTROLLER_ONLINE 11 |
#define | SYS_SERVER_HEARTBEAT 12 |
#define | SYS_RESET_CONFIG 13 |
#define | SYS_REBOOT_CONTROLLER 14 |
#define | SYS_DOWNLOAD_FIRMWARE 15 |
#define | SYS_RESTARTING 16 |
#define | SYS_FIRMWARE_UPDATING 17 |
#define | SYS_KEEP_ALIVE 18 |
#define | SYS_RESET_DEVICE_CONFIG 19 |
#define | SYS_SERVER_SHUTDOWN 20 |
#define | SYS_FIND_CONTROLLER 21 |
#define | SYS_RESET_NOTIFICATION_LIST 22 |
#define | SYS_LOCK_DEVICE 23 |
#define | SYS_LOCK_ROUTE 24 |
#define | SYS_ROUTE_CONFIG_CHANGED 25 |
#define | SYS_DEVICE_CONFIG_CHANGED 25 |
UDP Messages are sent between controllers to execute commands and provide status updates. Each message is represented by a UDPMessage
#define BLK_STATUS 2 |
Block Device status message
#define DEVICE_STATUS 3 |
Generic Device status message. The message payload contains an array of up to 8 device's and their current status.
#define END_STATUS_MESSAGES 5 |
Place holder; used in for loops to determine the upper bound of status message IDs
#define SYS_ACK 10 |
Message Acknowledgement. ID property and transaction number contains the orignal ID and transaction of the sent message.
#define SYS_CONTROLLER_ONLINE 11 |
Controller Online message. ID property contains the sending controller's controllerID. The controller checks its list of controllers-to-notify. If the controllerID is in the notification list, the controller responds by sending its own SYS_CONTROLLER_ONLINE message back to the sending controller. The controller then has all its devices send their current status messages to the notification list.
#define SYS_DEVICE_CONFIG_CHANGED 25 |
A Device's configration has changed. ID property contains the deviceID of the device that's been modified. This causes the Devices in each controller to download the new configuration for the device.
#define SYS_DOWNLOAD_FIRMWARE 15 |
Download Controller firmware message. ID property contains the serialNumber of the target controller or 0. When the ID property is set to 0, all controllers respond to the message. The controller will respond by making a http RESTful API call to the server using the url /controller/firmware?serialNumber=xxx where xxx is the controller's serial number. The server will send back the latest version of the controller firmware. Once downloaded, the controller will restart and install the new firmware. See the Controller RESTful API for more information.
#define SYS_FIND_CONTROLLER 21 |
Find Controller message. ID property contains the conntrollerID of the sought after controller. This message is sent as a broadcast message by the sending controller which puts its IP address in field[0], field[1], field[2] and field[3] of the message's payload. If the ID matches the receiving controller's controllerID it responds by sending a SYS_CONTROLLER_ONLINE message to the sender followed by device status messages.
#define SYS_FIRMWARE_UPDATING 17 |
Controller Keep-alive message. No longer used. Keeping for future use if needed
#define SYS_KEEP_ALIVE 18 |
Controller Firmware upgrade message. The controller is downloading and updating its firmware.
#define SYS_LOCK_DEVICE 23 |
Lock Device message. ID property contains the deviceID of the device that should be (un)locked. Field[0] contains a 1 or 0 indicating the device should lock or unlock iteslf. Currently, Turnout, Signal and Panel Input devices respond to this command.
#define SYS_LOCK_ROUTE 24 |
Lock Route message. ID property contains the routeID of the route that should be (un)locked. Field[0] contains a 1 or 0 indicating the route should be locked or unlocked respectively. Turnout devices respond to this message by checking its configuration data to see if the turnout is assigned to the specified route. If so, the turnout sets its state to the state defined in the route configuration and sets its locked flag to on. Once locked, the turnout will ignore all TRN_ACTIVATE and TRN_ACTIVATE_ROUTE commands until it receives a corresponding SYS_LOCK_ROUTE command with its field[0] set to 0 (unlock).
#define SYS_REBOOT_CONTROLLER 14 |
Reboot Controller message. ID property contains the serialNumber of the target controller or 0. When the ID property is set to 0, all controllers respond to the message by doing a soft reboot. This means the microcontroller will reboot. NOTE: This does not reset the hardware connected to the controller, only the microcontroller will reboot. If the controller is experiencing other issues (modules not responding, etc) the soft reboot may not solve the problem and a hard reboot (by turning the controller off and then back on) may be required.
#define SYS_RESET_CONFIG 13 |
Controller Reset Configuration message. ID property contains the serialNumber of the target controller or 0. When the ID property is set to 0, all controllers will reset their configuration. In response, controllers will delete all configuration files contained in their flash memory and then reboot. Upon restarting, the controller will detect the absence of the controllers configruation file and start the process of downloading its configuration data from the server using a http RESTful API call to the server using the url /controller/config?serialNumber=xxx where xxx is the controller's serial number. See the Controller RESTful API for more information.
#define SYS_RESET_DEVICE_CONFIG 19 |
Controller Reset Device Configuration message. ID property contains the deviceID of the target device. In response, the target device will delete all configuration files contained in the flash memory and then start the process of downloading its configuration data from the server using a http RESTful API call to the server using the url /controller/device/config?deviceID=xxx where xxx is the device's id number. See the Controller RESTful API for more information.
#define SYS_RESET_NOTIFICATION_LIST 22 |
Reset Controller Notification List message. ID property contains the serialNumber of the target controller or 0. When the ID property is set to 0, all controllers respond to the message. The controller will respond by making a http RESTful API call to the server using the url /controller/notification_list?serialNumber=xxx where xxx is the controller's serial number. The server will send back a list of controllerIDs the controller must notify when sending commands or status messages. The list is then saved in the controller's configuration data stored on flash memory.
#define SYS_RESTARTING 16 |
Controller Restarting message. ID property contains the serialNumber of the controller. Controllers send this message just before the controller is about to restart.
#define SYS_ROUTE_CONFIG_CHANGED 25 |
A Route's definition/configration has changed. ID property contains the routeID of the route that's been modified. This causes the RouteMonitor in each controller to download the new configuration for the route.
#define SYS_SERVER_HEARTBEAT 12 |
Application Server Heartbeat message. The application server sends this message every 60 seconds. The message contains the server's IP address in field[0], field[1], field[2] and field[3] of the message's payload. Field[4] contains a 1 the first time the controller sends a heartbeat message and 0 on subsequent messages. Controllers use the field[4] as a flag to determine when the server is coming online (possibly after a server restart). The controller will respond by sending device status messages to the application server when this flag is set to 1.
#define SYS_SERVER_SHUTDOWN 20 |
Server shutdown message. Sent by the Application Server when the server is shutting down or restarting.
#define TRN_ACTIVATE 6 |
Activate Turnout message. ID property contains the deviceID of the turnout to activate. Field0 property contains the TurnoutState (TrnUnknown, TrnNormal or TrnDiverging). If Field0 is set to TrnUnknown, the command "toggles" the turnout between Normal and Diverging.
#define TRN_ACTIVATE_ROUTE 7 |
Activate Turnout route message. ID property contains the routeID. The Turnout device locates the route in its configuration data and sets the turnout state as defined by the route.
#define TRN_STATUS 1 |
Turnout Device status message