Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Using the SDK

Pierre edited this page Jan 5, 2024 · 4 revisions

Introduction

VectorAudio features a simple interface to allow you to read in real time which stations are transmitting on all the channels you are listening to. This can be useful in the development of a Radio Direction Finder tool, for example.

Server Interface

VectorAudio run an HTTP server on 0.0.0.0:49080 (see below to change the port).

Websocket endpoint and messages

VectorAudio runs a websocket server on ws://0.0.0.0:49080/ws

The following packets are available and will be sent by VectorAudio automatically when the relevant event occurs. Upon connection, VectorAudio will immediately send a kFrequencyStateUpdate message with the current status of all frequencies. All frequencies in the WebSocket endpoint are in Hertz

Example of kRxBegin message:

  • @type: the type of the message
  • @value: the callsign of the station (pilot or ATC) who started transmitting the radio, and the frequency which is being transmitted on
  • JSON:
    {"type": "kRxBegin", "value": {"callsign": "AFR001", "pFrequencyHz": 123000000}}

Example of kRxEnd message:

  • @type: the type of the message
  • @value: the callsign of the station (pilot or ATC) who stopped transmitting the radio, and the frequency which was being transmitted on
  • JSON:
    {"type": "kRxEnd", "value": {"callsign": "AFR001", "pFrequencyHz": 123000000}}

Example of kFrequencyStateUpdate message:

  • @type: the type of the message
  • @value: The state of each frequency being used in VectorAudio, separated in frequencies that are RX, TX, or XC or multiple of those.
  • JSON:
{
  "type": "kFrequencyStateUpdate",
  "value": {
    "rx": [
      {
        "pFrequencyHz": 118775000,
        "pCallsign": "EDDF_S_TWR"
      }
    ],
    "tx": [
      {
        "pFrequencyHz": 119775000,
        "pCallsign": "EDDF_N_TWR"
      }
    ],
    "xc": [
      {
        "pFrequencyHz": 121500000,
        "pCallsign": "EDDF_S_GND"
      }
    ]
  }
}

HTTP Endpoints

The following endpoints are implemented

GET /* -> returns 'VectorAudio/0.0.0' with the current version string

GET /transmitting -> returns nothing or a comma delimited list of callsigns which are transmitting. Empty if nothing.
GET /rx -> returns a comma delimited packet of each frequency that is currently on RX, see example. Empty if nothing.
GET /tx -> returns a comma delimited packet of each frequency that is currently on TX, see example. Empty if nothing.

Examples:

GET /transmitting -> EJU1652,LSGG_TWR
GET /transmitting -> AFR007
GET /tx -> LFPG_TWR:118.700,LFMN_APP:134.475
GET /rx -> EGLL_N_TWR:118.700

Changing the default port

The default port of 49080 can be changed through the config.toml file by adding or changing the following:

[general]
api_port = 69420

Limitations

  • HTTPS is not supported
  • WSS is not supported