Used in websocket communication between client & radio daemon. Most command exchanges begin on the client and are responded to by the daemon. The daemon does not query the client at any point in time.
Used to inform the client on the status of the radio. (server-to-client only)
{
"status": {
"name": "",
"zone": "",
"chan": "",
"lastid": "",
"state": "Disconnected",
"muted": false,
"scanning": false,
"priority": 0,
"error": false,
"errorText": "",
"softkeys": [],
"softkeyStates": []
}
}
This status JSON is created in the radioClass.py
encodeClientStatus()
function
These are sent from the client to the daemon
{
"radioControl": {
"command": "startTx",
"options": null
}
}
command
can be any of the following:
startTx
/stopTx
are used to start and stop PTTchanUp
/chanDn
are used to change channelschanGoto
is used to goto a specific channel index (not yet implemented)- requires a number in the
options
field
- requires a number in the
button
indicates a button press.options
specifies the button, valid options are:softkey1
throughsoftkey5
requisite softkey (dynamic for O5 control head or static for user-defined buttons)left
andright
for paging through softkeys
These are used to control various audio functions
{
"audioControl": {
"command": "mute",
}
}
command
can be any of the following:
startAudio
is used to initialize the server-side audio handling routines.index
should benull
in this casemute
/unmute
are used to mute/unmute a specific radio.index
must be specified
This is used for sending audio data arrays between the client and server
{
"audioData": {
"source": "mic",
"data": "csv mic samples"
}
}
source
can be either mic
or speaker
data
contains the array of mu-law encoded audio samples (as a comma-separated string)
These are sent both ways, and contain signalling messages for WebRTC configuration
{
"webRtcOffer": {
"type": {},
"sdp": {}
}
}
This is the initial WebRTC offer from the client to the server.
type
contains the SDP type
sdp
contains the SDP data
{
"webRtcAnswer": {
"type": {},
"sdp": {}
}
}
This is the WebRTC SDP answer from the server to the client
type
contains the SDP type
sdp
contains the SDP data
{
"nack": {}
}