Line 20: | Line 20: | ||
==Protocol== | ==Protocol== | ||
− | Uses '''WebSocket''' port | + | Uses '''WebSocket''' Draft_6455 and TCP port 8275. |
===Example passing PDU=== | ===Example passing PDU=== | ||
Line 47: | Line 47: | ||
* competition: ChronoFly competition identifier | * competition: ChronoFly competition identifier | ||
* signature: Data signature based on keys negotiated during ChronoFly registration | * signature: Data signature based on keys negotiated during ChronoFly registration | ||
+ | |||
+ | * event: event type | ||
+ | * id: event id (always incremented by 1) | ||
+ | * 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 (always incremented by 1) | ||
===Example connection PDU=== | ===Example connection PDU=== | ||
Line 67: | Line 76: | ||
* competition: ChronoFly competition identifier | * competition: ChronoFly competition identifier | ||
* signature: Data signature based on keys negotiated during ChronoFly registration | * signature: Data signature based on keys negotiated during ChronoFly registration | ||
+ | |||
+ | * event: event type | ||
+ | * id: event id (always incremented by 1) |
Revision as of 22:08, 15 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) { conn.on("text", function(msg) { var dataObject = JSON.parse(msg); 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.
Example passing PDU
Sent whenever passing (transponder or manual) is registered on ChronoFly.
{ "station": "ChronoFly-12345", "competition": "166656", "signature": "c39cfef55ac1b4", "data": { "event": "passing", "id": "70", "type": "Route-TC-Finish", "round": "ET 4 TC 9 Huhdanoja A", "time": "20:47:57.765", "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 (always incremented by 1)
- 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 (always incremented by 1)
Example connection PDU
Sent whenever ChronoFly connects to the WebSocket server.
{ "station": "ChronoFly-12345", "competition": "166656", "signature": "642a417f03b2ea", "data": { "event": "connected", "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 (always incremented by 1)