Skip to content

Websocket Protocol

Thomas Gatzweiler edited this page Mar 10, 2018 · 9 revisions

Commands

{"SetConfig": config}

Update the configuration.

"DefaultConfig"

Reset the configuration to the default.

{"SendMessage": {"addr": 12345, "data": "Message Content"}}

Send an alphanumeric POCSAG message to the specified address.

"GetConfig"

Get the current configuration.

"GetVersion"

Get the version of UniPager.

"GetStatus"

Get the current status.

"Shutdown"

Shutdown UniPager.

"Restart"

Restarts the connection and the scheduler.

Responses

Status

Fields

Name Type Description
connected boolean true if UniPager is connected to the master
transmitting boolean true if UniPager is currently transmitting
timeslots [boolean] The time slot configuration
timeslot number The current time slot
queue number The number of messages in the queue
master string The master server UniPager is currently using
version string UniPager version
calls_tx number Total number of calls transmitted
calls_rx number Total number of calls received

Example

{
  "Status": {
    "connected": true,
    "transmitting": false,
    "timeslots": [false, false, true, true, false, false, true, false,
                  false, false, false, false, true, true, false, true],
    "timeslot": 14,
    "queue": 42,
    "master": "dapnet.afu.rwth-aachen.de",
    "version": "1.0.0",
    "calls_tx": 113252,
    "calls_rx": 113252
  }
}

Status Update

A Status Update contains a list of fields that are a subset of the Status response. If there is status change, UniPager sends a status update which contains only the changed fields.

Example

{
  "StatusUpdate": ["timeslot", 11]
}

Log

A Log response contains the log level and the log message.

Example

{"Log":[3,"Connection established."]}