Line 22: Line 22:
  
 
==Protocol==
 
==Protocol==
 +
 
Uses '''WebSocket''' Draft_6455 and TCP port 8275.
 
Uses '''WebSocket''' Draft_6455 and TCP port 8275.
 
===Confirmation rules===
 
 
Whenever server receives a PDU it is required to confirm it back to the sender (ChronoFly).
 
 
Response format is bumb-<data.id>
 
 
'''Example confirmation response'''
 
 
bumb-4291
 
 
If PDU is not confirmed back to sender (ChronoFly) it will be re-sent to server during next event cycle.
 
  
 
===Passing PDU===
 
===Passing PDU===
Line 49: Line 38:
 
         "type": "Route-TC-Finish",
 
         "type": "Route-TC-Finish",
 
         "round": "ET 4 TC 9 Huhdanoja A",
 
         "round": "ET 4 TC 9 Huhdanoja A",
         "time": "20:47:57.765",
+
         "time": "2007-11-20T22:19:17.532+02:00",
 
         "transponder": "7",
 
         "transponder": "7",
 
         "hits": "0",
 
         "hits": "0",
Line 70: Line 59:
 
* hits: times same transponder has been seen during current passing event
 
* hits: times same transponder has been seen during current passing event
 
* lap: times same transponder has been seen during selected round (incremented by 1)
 
* lap: times same transponder has been seen during selected round (incremented by 1)
 +
 +
====Confirmation rules====
 +
 +
Whenever server receives a PDU it is required to confirm it back to the sender (ChronoFly).
 +
 +
Response format is: bumb-<data.id>
 +
 +
'''Example confirmation response'''
 +
 +
bumb-4291
 +
 +
If PDU is not confirmed back to sender (ChronoFly) it will be re-sent to server during next event cycle.
 +
 +
====Supported station types====
 +
 +
* Route-Finish
 +
* Route-Start
 +
* Route-Pause
 +
* TC-Time
 +
* TC-Separate
 +
* TC-Pause
 +
* Route-TC-Finish
 +
* Route-TC-Start
 +
* Track-Finish
 +
* Track-Sector
  
 
===Connection PDU===
 
===Connection PDU===
Line 81: Line 95:
 
     "data": {
 
     "data": {
 
         "event": "connected",
 
         "event": "connected",
         "id": "0"
+
         "id": "0",
 +
        "version": "1.2.30"
 
     }
 
     }
 
  }
 
  }
Line 93: Line 108:
 
* event: event type
 
* event: event type
 
* id: event id (incremented by 1 and zeroed when round changed or tables cleared)
 
* id: event id (incremented by 1 and zeroed when round changed or tables cleared)
 +
* version: ChronoFly version
  
 
===Keepalive PDU===
 
===Keepalive PDU===
Line 116: Line 132:
 
* event: event type
 
* event: event type
 
* id: event id (incremented by 1 and zeroed when websocket tcp stream opened)
 
* id: event id (incremented by 1 and zeroed when websocket tcp stream opened)
 +
 +
====Confirmation rules====
 +
 +
Whenever server receives a PDU it is required to confirm it back to the sender (ChronoFly).
 +
 +
Response format is: pong
 +
 +
'''Example confirmation response'''
 +
 +
pong
 +
 +
If PDU is not confirmed back to sender (ChronoFly) it will be re-sent to server during next event cycle.
  
 
===Malfunction PDU===
 
===Malfunction PDU===
Line 143: Line 171:
 
* message2: additional malfunction desctiption
 
* message2: additional malfunction desctiption
 
* type: malfunction type
 
* type: malfunction type
 
==Supported station types==
 
 
* Route-Finish
 
* Route-Start
 
* Route-Pause
 
* TC-Time
 
* TC-Separate
 
* TC-Pause
 
* Route-TC-Finish
 
* Route-TC-Start
 
* Track-Finish
 
* Track-Sector
 

Revision as of 21:00, 18 December 2017

ChronoCloud 2 protocol enables other applications to aquire real time timing data from ChronoFly.

Application is required to establish a WebSocket server where ChronoFly can send real time timing data.

WebSocket server example

NodeJs

var ws = require("nodejs-websocket");

var server = ws.createServer(function(conn) {
    var station;
    conn.on("text", function(msg) {
        var dataObject = JSON.parse(msg);
        station = dataObject.station;
        conn.sendText("bumb-" + dataObject.data.id);
        console.log(Date() + " got time " + dataObject.data.time);
    });
    conn.on("close", function(code, reason) {
        console.log(Date() + " " + station + " not publishing anymore");
    });
}).listen(8275);

Protocol

Uses WebSocket Draft_6455 and TCP port 8275.

Passing PDU

Sent whenever passing (transponder or manual) is registered on ChronoFly.

{
    "station": "ChronoFly-12345",
    "competition": "166656",
    "signature": "c39cfef55ac1b471",
    "data": {
        "event": "passing",
        "id": "70",
        "type": "Route-TC-Finish",
        "round": "ET 4 TC 9 Huhdanoja A",
        "time": "2007-11-20T22:19:17.532+02:00",
        "transponder": "7",
        "hits": "0",
        "lap": "5"
    }
}

Where

  • station: ChronoFly station identifier
  • competition: ChronoFly competition identifier
  • signature: Data signature based on keys negotiated during ChronoFly registration
  • event: event type
  • id: event id (incremented by 1 and zeroed when round changed or tables cleared)
  • type: station type selected currently at ChronoFly
  • round: round name selected currently at ChronoFly
  • time: passing time
  • transponder: passing transponder number
  • hits: times same transponder has been seen during current passing event
  • lap: times same transponder has been seen during selected round (incremented by 1)

Confirmation rules

Whenever server receives a PDU it is required to confirm it back to the sender (ChronoFly).

Response format is: bumb-<data.id>

Example confirmation response

bumb-4291

If PDU is not confirmed back to sender (ChronoFly) it will be re-sent to server during next event cycle.

Supported station types

  • Route-Finish
  • Route-Start
  • Route-Pause
  • TC-Time
  • TC-Separate
  • TC-Pause
  • Route-TC-Finish
  • Route-TC-Start
  • Track-Finish
  • Track-Sector

Connection PDU

Sent whenever ChronoFly connects to the WebSocket server.

{
    "station": "ChronoFly-12345",
    "competition": "166656",
    "signature": "642a417f03b2ea3b",
    "data": {
        "event": "connected",
        "id": "0",
        "version": "1.2.30"
    }
}

Where

  • station: ChronoFly station identifier
  • competition: ChronoFly competition identifier
  • signature: Data signature based on keys negotiated during ChronoFly registration
  • event: event type
  • id: event id (incremented by 1 and zeroed when round changed or tables cleared)
  • version: ChronoFly version

Keepalive PDU

Sent every 30 seconds to the WebSocket server.

{
    "station": "ChronoFly-12345",
    "competition": "166656",
    "signature": "642a417f03b2ea3b",
    "data": {
        "event": "keepalive",
        "id": "0"
    }
}

Where

  • station: ChronoFly station identifier
  • competition: ChronoFly competition identifier
  • signature: Data signature based on keys negotiated during ChronoFly registration
  • event: event type
  • id: event id (incremented by 1 and zeroed when websocket tcp stream opened)

Confirmation rules

Whenever server receives a PDU it is required to confirm it back to the sender (ChronoFly).

Response format is: pong

Example confirmation response

pong

If PDU is not confirmed back to sender (ChronoFly) it will be re-sent to server during next event cycle.

Malfunction PDU

Sent every 30 seconds to the WebSocket server.

{
    "station": "ChronoFly-12345",
    "competition": "166656",
    "signature": "642a417f03b2ea3b",
    "data": {
        "event": "malfunction",
        "message": "java.net.SocketException: Connection timeout at com.enymind.drivers.MercuryComm.connect()",
        "message2": "Unknown error",
        "type": "1"
    }
}

Where

  • station: ChronoFly station identifier
  • competition: ChronoFly competition identifier
  • signature: Data signature based on keys negotiated during ChronoFly registration
  • event: event type
  • message: malfunction desctiption
  • message2: additional malfunction desctiption
  • type: malfunction type