The Client (GlobalTuners radio server) connects to the Radio Control Server using a TCP stream, named or unnamed pipe. The Client sends a "RADIO CONTROL" command which can be used to identify the connection and waits for a successful response. All commands and values should be sent in upper case, but lower case characters should be accepted as well! All communication is synchronous, the Radio Control Server may only send one single command in reply to a Request from it's client. In addition, both sides may, at all times, close the connection. Only the first 128 8-bit ASCII characters can be used. Each message consists of a command part and optional arguments, separated by a space character. Each command is terminated by a NewLine/LineFeed/ASCII 10/"\n" character. Radio control: Handshake (Client -> Radio/Server, after the connection has been established): RADIO CONTROL [x] [p] Sent after the connection has been established to indicate that this is a control connection [x] is the protocol version (currently 1) [p] is the connection password (preferably only alphanumeric characters) Handshake (Radio/Server -> Client, in reply to the Client handshake): EP Protocol version not accepted (connection should be closed after this message has been sent or received) EA Password not accepted (connection should be closed after this message has been sent or received) OK Protocol and password accepted CAP BND [a]:[b] [a]:[b] Specifies frequency limits [a] is the first frequency of the range [b] is the last frequency of the range An infinite number of ranges can be specified, but it's recommended to keep this number as small as possible. The frequency ranges should be specified in order and may not overlap! CAP MOD [m]:[d] [m]:[d] Specifies possible reception modes/modulations [m] is the mode index (1-255), see below for recommended values [d] is the mode text (AM, WFM, etc, this should consist of only alphanumeric characters) CAP FIL [f]:[d] [f]:[d] Specifies possible bandpass filters [f] is the mode index (1-255) Recommended values: 3, 6, 15, 50 and 230 Recommendation is to choose an index close to the filter bandwidth in kHz) [d] is the filter text (15kHz, 50kHz, narrow, wide, etc, this should consist of only alphanumeric characters) CFG GET [n] Retrieve configuration [n] is the name of the configuration option Returns: "OK [v]" [v] is the configuration value Returns: "EN" Configuration optionwas not found RDY End of handshake, communication can begin Request (Client -> Radio/Server): EXIT Drop the connection (not required, useful for telnet/commandline usage) TUNE [f] [m] [b] Tunes the receiver [f] is the requested frequency in Hz, or 0 for no change [m] is the requested mode, as specified by the "CAP MOD" command, or 0 for no change [b] is the requested filter, as specified by the "CAP FIL" command, or 0 for no change Returns: "OK [f] [m] [b]" [f] is the actual frequency (rounded if neccessary, current value if 0 is requested) [m] is the actual mode (closest match, current value if 0 is srequested) [b] is the actual filter (closest match, current value if 0 is requested) Returns: "EU [m]" An undefined error has occured [m] is an error message OPTION [o] [v] Sets receiver option [o] is the requested option number (see below) [v] is the requested value (0-255 or 0 for 'off', everything else for 'on') Returns: "OK [v]" [v] is the actual value (may be rounded or changed to 1 if >1 is specified for boolean options) Returns: "EI" The option is not available Returns: "EU [m]" An undefined error has occured Notification (Radio/Server -> Client, these can always be sent, after the initial handshake): Audio streaming: Request (Client -> Radio/Server): RADIO AUDIO [x] [p] Sent after the connection has been established to indicate that this is a control connection [x] is the protocol version (currently 1) [p] is the connection password (preferably only alphanumeric characters) EXIT Drop the connection (not required, useful for telnet/commandline usage) START Start streaming audio data (make sure it is aligned!) STOP Stop streaming audio data (make sure the last block is complete!) Response (Radio/Server -> Client): Right after the RADIO AUDIO command: FORMAT [samplerate] [channels] [bitspersample] After that, the server may only send raw wave data in the specified format.