C Class Messages

From Open Rail Data Wiki
Revision as of 09:38, 20 May 2013 by Jonathon Hurley (talk | contribs) (Moved detail of C-Class messages to a separate page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

C-Class train describer messages provide updates relating to the stepping of train descriptions between TD berths.

There are four types of C-Class message:

Type Name Details
CA Berth Step The CA message is a 'step' message.

This moves the description from the 'from' berth, in to the 'to' berth, cancelling the description in the 'from' berth and overwriting any description in the 'to' berth.

CB Berth Cancel The CB message is a 'cancel' message.

This cancels the description in the 'from' berth.

CC Berth Interpose The CC message is an 'interpose' message.

This inserts the description in to the 'to' berth, overwriting any description in the 'to' berth.

CT Heartbeat The CT message is a 'heartbeat' message, periodically sent from a train describer.

Message Format

Messages are sent in JSON format, as follows:

  • {"CA_MSG":{"time":"1349696911000", "area_id":"SK", "msg_type":"CA", "from":"3647", "to":"3649", "descr":"1F42"}}
  • {"CB_MSG":{"time":"1349696911000", "area_id":"G1", "msg_type":"CB", "from":"G669", "descr":"2J01"}}
  • {"CC_MSG":{"time":"1349696911000", "area_id":"G1", "msg_type":"CC", "descr":"2J01", "to":"G669"}}
  • {"CT_MSG":{"time":"1349696911000", "area_id":"SA", "msg_type":"CT", "report_time":"1249"}}

Message Fields

Field CA CB CC CT Details
time Message time

UNIX timestamp in milliseconds since the UNIX epoch

area_id Alphanumeric code representing the TD area that the message originates from (see list of train describers)
msg_type Type of message

Can be CA_MSG, CB_MSG, CC_MSG or CT_MSG

from From berth (see TD berths page)
to To berth (see TD berths page)
descr Train description

Four-letter alphanumeric code representing the headcode or description of the train

report_time Reporting time