(Created page with "Jee")
 
Line 1: Line 1:
Jee
+
ChronoCloud 2 protocol enables other applications to aquire real time timing data from ChronoFly.
 +
 
 +
<u>Do not expose your timing network for unauthorized access!</u> There is no authentication mechanism in this WebSocket implementation.
 +
 
 +
==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",
 +
    "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"
 +
    }
 +
}
 +
 
 +
==Example connection PDU==
 +
{
 +
    "station": "ChronoFly-12345",
 +
    "competition": "166656",
 +
    "data": {
 +
        "event": "connected",
 +
        "id": "0"
 +
    }
 +
}

Revision as of 22:54, 15 December 2017

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

Do not expose your timing network for unauthorized access! There is no authentication mechanism in this WebSocket implementation.

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",
    "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"
    }
}

Example connection PDU

{
    "station": "ChronoFly-12345",
    "competition": "166656",
    "data": {
        "event": "connected",
        "id": "0"
    }
}