DataChannel messages

Messages are sent as JSON objects, with a mandatory key "type" which defines the message internal structure. pckt := map[string]interface{}{ "type": "klv", "packetTime": 0, "klvs": klvs, }

type Description
"klv" Klv data packet
"state" Channel state (online, lost, offline)
"msg" Message packet

Klv data packet

Klv data packet example

{
    "type": "klv",
    "packetTime": 0,
    "klvs":  {
        "2": 1348087840159239,
        "3": "MISSION01",
        "13": 60.176822967,
        "14": 128.426759042,
        "15": 14190.72,
        "16": 144.5713,
        "65": 13,
        "1": 53482
    }     
}

State packet

type Description
Online Stream is online.
Timeout Stream timeout. Stream is not present for "timeout" arg period
Offline Stream lost. Stream is not present for "offlineAfter" arg period
DemoExpired Demo expired.

Note. Timeout and Offline states are only reported for multicast streams.

Message packet example

{
    "type": "state",
    "state": "Timeout"     
}

Message packet

Message packet example

{
    "type": "msg",
    "msg": "Demo expired"     
}