YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.session.SendspinMessages Class Reference

The messages of the protocol that the server role writes and reads (core and player@v1), as plain values. More...

Collaboration diagram for de.yaacc.sendspin.session.SendspinMessages:
Collaboration graph

Classes

class  ClientHello
 client/hello: what the server uses of it.
 
class  ClientState
 client/state.
 
class  Format
 One entry of supported_formats.
 
class  PlayerState
 The player object of client/state.
 

Static Public Member Functions

static String serverError (String reason)
 
static String serverInit (String serverId)
 
static String noiseHandshake (String data)
 
static String serverHello (String name)
 
static String serverHello (String name, List< String > sourceCodecs)
 server/hello of a server that takes audio from a source (source@v1): the codecs it accepts are listed in source@v1_support.
 
static String serverActivate (List< String > activities, List< String > activeRoles)
 
static String serverActivatePairing ()
 server/activate that admits a pairing attempt with the Pairing PSK (no playback, no roles).
 
static String serverPairFinalize ()
 server/pair-finalize: the server has stored the pairing record.
 
static String serverTime (long clientTransmitted, long serverReceived, long serverTransmitted)
 
static String groupUpdate (boolean playing, String groupId, String groupName)
 
static String streamStartPcm (long serverTransmitted, int sampleRate, int channels, int bitDepth)
 stream/start for the player role in PCM.
 
static String streamStartFlac (long serverTransmitted, int sampleRate, int channels, int bitDepth, byte[] codecHeader)
 stream/start for the player role in FLAC: codecHeader is the fLaC marker and the STREAMINFO block (the specification demands it as standard Base64 in codec_header).
 
static String streamStartOpus (long serverTransmitted, int sampleRate, int channels)
 stream/start for the player role in Opus: no codec header (the decoder is configured from the rate and the channels).
 
static String streamClear (long serverTransmitted, Long fromTimestamp)
 stream/clear for the player role; fromTimestamp null clears everything buffered.
 
static String streamEnd ()
 
static String commandVolume (int volume)
 
static String commandMute (boolean mute)
 
static String commandOutputDelay (int milliseconds)
 
static byte[] audioChunk (long timestampMicros, long sendAheadMicros, byte[] audio, int offset, int length)
 The body of a binary audio chunk (message id AUDIO_CHUNK_ID, which the channel adds): the timestamp (big-endian int64, server clock in microseconds), send_ahead (big-endian uint32: microseconds from transmission to the timestamp; 0 if transmitted at or after it, 4294967295 if the lead is too long to represent) and the encoded audio.
 
static byte[] audioChunkLegacy (long timestampMicros, byte[] audio, int offset, int length)
 The audio chunk of the older wire: the timestamp (int64, big endian) and the audio, without the send-ahead field.
 
static String legacyServerHello (String serverId, String name, List< String > activeRoles, String connectionReason)
 server/hello of the older wire: it replaces server/hello and server/activate and names the active roles.
 
static ClientHello parseClientHello (JSONObject p) throws ProtocolException
 
static ClientHello parseLegacyClientHello (JSONObject p) throws ProtocolException
 The hello of a client of the older, unencrypted wire: it also needs a client_id (plain text of at most 64 bytes) and a session with it is always unpaired.
 
static ClientState parseClientState (JSONObject p) throws ProtocolException
 
static ClientState parseLegacyClientState (JSONObject p, List< String > helloCommands) throws ProtocolException
 client/state of the older wire: the delay may be called static_delay_ms and the commands are not repeated here (they were in the hello).
 
static long parseClientTime (JSONObject p) throws ProtocolException
 client/time: the client's timestamp in microseconds.
 
static String parseGoodbyeReason (JSONObject p) throws ProtocolException
 client/goodbye: the reason, as the protocol names it.
 
static int parsePairingIndex (JSONObject p) throws ProtocolException
 client/pair-init: the pairing index (the number of pairing activations the client has seen since the last handshake).
 
static String parseLongTermPsk (JSONObject p) throws ProtocolException
 client/pair-finalize of the Pairing PSK flow: the 43 characters of the long-term PSK.
 
static String parsePairAbortReason (JSONObject p) throws ProtocolException
 pair/abort: the reason.
 
static String parseNoiseData (JSONObject p) throws ProtocolException
 The payload of noise/handshake: the bytes of the Noise message.
 

Static Public Attributes

static final int AUDIO_CHUNK_ID = 4
 The binary message id of an audio chunk.
 
static final int JSON_ID = 0
 The binary message id of a JSON message.
 
static final int FRAGMENT_ID = 1
 The binary message id of a fragment.
 

Detailed Description

The messages of the protocol that the server role writes and reads (core and player@v1), as plain values.

Builders return the JSON text; parsers check every field against the range the specification gives and throw a ProtocolException for a value outside it, which the receiver answers by closing the connection.

Member Function Documentation

◆ parseLegacyClientHello()

static ClientHello de.yaacc.sendspin.session.SendspinMessages.parseLegacyClientHello ( JSONObject p) throws ProtocolException
static

The hello of a client of the older, unencrypted wire: it also needs a client_id (plain text of at most 64 bytes) and a session with it is always unpaired.

The player support object lists the commands the player takes.

◆ serverHello()

static String de.yaacc.sendspin.session.SendspinMessages.serverHello ( String name,
List< String > sourceCodecs )
static

server/hello of a server that takes audio from a source (source@v1): the codecs it accepts are listed in source@v1_support.

Null or empty: the server takes no source, the hello is the plain one.


The documentation for this class was generated from the following file: