Line 1: | Line 1: | ||
ChronoCloud 2 protocol enables other applications to aquire real time timing data from ChronoFly. | ChronoCloud 2 protocol enables other applications to aquire real time timing data from ChronoFly. | ||
− | |||
− | |||
==Usage example== | ==Usage example== | ||
Line 26: | Line 24: | ||
"station": "ChronoFly-12345", | "station": "ChronoFly-12345", | ||
"competition": "166656", | "competition": "166656", | ||
+ | "signature": "c39cfef55ac1b4", | ||
"data": { | "data": { | ||
"event": "passing", | "event": "passing", | ||
Line 37: | Line 36: | ||
} | } | ||
} | } | ||
+ | |||
+ | '''Where''' | ||
+ | |||
+ | * station: ChronoFly station identifier | ||
+ | * competition: ChronoFly competition identifier | ||
+ | * signature: Data signature based on keys negotiated during ChronoFly registration | ||
==Example connection PDU== | ==Example connection PDU== | ||
Line 42: | Line 47: | ||
"station": "ChronoFly-12345", | "station": "ChronoFly-12345", | ||
"competition": "166656", | "competition": "166656", | ||
+ | "signature": "642a417f03b2", | ||
"data": { | "data": { | ||
"event": "connected", | "event": "connected", | ||
Line 47: | Line 53: | ||
} | } | ||
} | } | ||
+ | |||
+ | '''Where''' | ||
+ | |||
+ | * station: ChronoFly station identifier | ||
+ | * competition: ChronoFly competition identifier | ||
+ | * signature: Data signature based on keys negotiated during ChronoFly registration |
Revision as of 22:57, 15 December 2017
ChronoCloud 2 protocol enables other applications to aquire real time timing data from ChronoFly.
Usage 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 port: 8275
Example passing PDU
{ "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
Example connection PDU
{ "station": "ChronoFly-12345", "competition": "166656", "signature": "642a417f03b2", "data": { "event": "connected", "id": "0" } }
Where
- station: ChronoFly station identifier
- competition: ChronoFly competition identifier
- signature: Data signature based on keys negotiated during ChronoFly registration