Modern professional audio devices are designed as building blocks for large, complex systems.
Whereas audio signal paths have converged to industry standards a long time ago, driven by prac-
tical necessities, and only recently challenged by new transport technologies like Ethernet, the professional audio markets have not evolved a similar technological convergence in the area of remote,
centralised control of systems of audio equipment (the notable historical exception being MIDI, which
but has a limited scope and extensibility).
In this heterogeneous environment of diverging standards proposed by individual vendors as well
as open communities, there is no existing self-evident solution to be found for the needs raised by
designing professional Sennheiser audio equipment.
As a consequence, communication protocols implemented in Sennheiser products have so far been
designed on a single-product or product-family basis. This has worked sufficiently well, up to the
point that separately developed protocols start to concur in nexus devices or applications, like:
• Wireless Systems Manager (PC-based control application for wireless transmission)
• remote channel for Sennheiser microphones
• Media Control Systems (third party products, e.g., Crestron)
• A/V studio integration (third party products, e.g., Lawo)
• smartphone or tablet apps
• future centralised Sennheiser services
It has become evident that product-specific protocols fail to scale well in nexus products because
of the added complexity in re-implementing the same remote control functionality from a customer
point of view in a multitude of different backwards-compatible ways. It is not feasible to add more
ever different technical solutions to the existing variety --- the aim must be to define a reasonably
future-proof protocol suitable for existing as well as envisioned products, devices, and services.
A broad market evaluation of existing technical solutions was performed in a joint Sennheiser PRO
division working group. As a result, it turns out that Open Sound Control comes closest to the specific needs for an extensible, future-proof command, control, metering, and configuration protocol for
Sennheiser products.
This document describes the specific adaption of Open Sound Control to Sennheiser use, "Sennheiser Sound Control", SSC. The main other ingredient is JavaScript Object Notation (JSON), which
enhances ease-of-use and the implementation complexity for small to smallest devices.
Note that the protocol is intended for command and control. Network audio streaming is entirely out
of its scope.
SSC Developer‘s guide for Digital 9000 | 6/62
Open Sound Control Overview
1. Open Sound Control Overview
Open Sound Control (OSC) is a protocol developed at The Center For New Music and Audio Technology (CNMAT) at University of California, Berkeley.
The OSC specification Version 1.1 is available from the Open Sound Control website at:
http://www.opensoundcontrol.org/ .
It is a very simple and very extensible protocol that can be implemented easily in embedded systems.
It can be transported over IPv4 and IPv6 protocols using UDP packets and TCP streams.
Even very small PIC microcontrollers can handle OSC messages via projects such as MicroOSC from
http://cnmat.berkeley.edu/research/uosc .
The OSC Schema defined by MicroOSC at:
http://cnmat.berkeley.edu/library/uosc_project_documentation/osc_address_schema
was used as a starting point for some parts of the schema defined in this document.
OSC handles more advanced packet formats such as bundles of messages to be atomically executed
at the same time with timestamps, as well as addresses with wildcards and array values.
1.1 JavaScript Object Notation Overview
JavaScript Object Notation (JSON) is a lightweight data-interchange format. It is easy for humans to
read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript
Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format
that is completely language independent but uses conventions that are familiar to programmers of
the C-family of languages, including C, C++, C#, Java, JavaScript, Ruby, Python, and many others.
These properties make JSON an ideal data-interchange language.
The central website for JSON information is http://json.org. JSON is formally specified in RFC 4627
(MIME-type application/json).
JavaScript Object Notation (JSON) is a text format for the serialization of structured data. It is derived from the object literals of JavaScript, as defined in the ECMAScript Programming Language
Standard, Third Edition.
JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured
types (objects and arrays).
A string is a sequence of zero or more Unicode characters.
An object is an unordered collection of zero or more name/value pairs, where a name is a string and
a value is a string, number, boolean, null, object, or array.
An array is an ordered sequence of zero or more values.
The terms "object" and "array" come from the conventions of JavaScript.
JSON’s design goals were for it to be minimal, portable, textual, and a subset of JavaScript.
SSC Developer‘s guide for Digital 9000 | 7/62
Conventions
2. Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD
NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP14/RFC 2119, "Key words for use in RFCs to Indicate Requirement Levels".
2.1 Terminology
SSC Messageprotocol unit of transmission
SSC Serverdevice or application that receives SSC messages, and replies to
them
SSC Clientdevice, application or person that sends SSC messages
SSC Containernamed entity containing SSC Methods or other Containers
SSC Methodnamed attribute or action callable on a SSC Server
SSC Addressfull name of a SSC Method, including names of all enclosing Con-
tainers.
may be represented by a JSON object hierarchy.
SSC Address Treea JSON object hierarchy consisting of one or more SSC Addresses.
SSC Address Spacehierarchical tree comprising all the SSC Addresses of a SSC Server
SSC Method CallSSC Message requesting execution of a SSC Method
SSC Method Argumentsarguments included in a SSC Method Call
SSC Method ReplySSC Message send by SSC Server as result of a Method Call
SSC Sessionassociation of a specific SSC Client to an SSC Server
binary OSCthe binary OSC encoding as opposed to JSON-based SSC
restricted SSC Servera SSC Server that doesn‘t implement some optional parts of this
specification
SSC Developer‘s guide for Digital 9000 | 8/62
SSC Data Structure Specification
3. SSC Data Structure Specification
3.1 Applying JSON to the OSC device model
OSC models the controlled device as a tree-shaped hierarchy of methods, with the method addresses
constructed from the names of all the nodes in the hierarchy, written like a file path.
/container at address "/"
out1/container at address "/ out1/"
xlr1/container at address "/out1/xlr1/"
gain 5address "/out1/xlr1/gain": method with numeric argu-
ment
mute trueaddress "/out1/xlr1/mute": method with boolean argu-
ment
...more methods of "/out1/xlr1"
xlr2/container at address "/out1/xlr2/"
...methods of "/out1/xlr2"
out2/container at address "/out2/"
...methods of "/out2"
...more methods and containers of "/"
JSON allows to model that structure as a hierarchy of JSON objects.
{root object"out1": {object "out1"
"xlr1": {object "out1.xlr1"
"gain": 5,numerical property "out1.xlr1.gain"
"mute": true,boolean property " out1.xlr1.mute"
...more properties of " out1.xlr1"
},
"xlr2": {object " out1.xlr2"
...properties of " out1.xlr2"
},
"out2": {object "out2"
...properties of "out2"
},
...more properties and objects of the root object
}
The OSC Method Address (like "/out1/xlr2/gain") is interpreted as a property path navigating through
the hierarchy of JSON objects. The value of each property MUST be either a primitive JSON data
type, or a JSON array. Rationale: This allows to clearly separate SSC Method Addresses from SSC
Method Arguments at JSON parser level without knowledge of the underlying method address tree.
The resulting JSON tree structure of hierarchical objects, the SSC Address Space, is tailored to describe the functionality of a specific SSC Server, in the same way as foreseen by OSC.
In JSON it is possible to serialise the complete state of all properties in the tree to a closed form,
thus describing the complete state of the SSC Server. In this way, JSON can be used as an excellent
extensible data format for configuration files, or for scripting applications, which drive a system of
SSC Servers through a sequence of programmed configurations.
SSC Developer‘s guide for Digital 9000 | 9/62
SSC Data Structure Specification
For command and control applications it is desirable to access single properties independently. This
can be achieved in JSON syntax by the simple convention, that all the properties of a SSC Server that
are not mentioned in a JSON message are left unchanged.
In this way, applied to the example above, the JSON form
{ "out1": { "xlr1": { "gain": 5 } } }
can be understood as a SSC Method Call of the SSC Method "/audio/out1/level_db" with the argument 5, presumably to set the level to that level, or as an SSC Method Reply message stating the
current level.
3.2 JSON Message Transaction Syntax
The SSC Message exchange is described here as transaction using the following syntax:
Prefix "TX:" indicates a SSC Message that a SSC Client is sending to a SSC Server.
Prefix "RX:" indicates a SSC Message that the SSC Server will send back to the Client.
A SSC-Message is written verbatim, enclosed by curly brackets { }.
A transaction to set the gain of "xlr2" of "out1" to −10 then looks like this:
TX: { "out1": { "xlr2": { "gain": −10 }}}
RX: { "out1": { "xlr2": { "gain": −10 }}}
Note that the execution of the method results in a method reply message, which for simple property
setters states the actual value of the property resulting from executing the message.
The resulting value may be different from the supplied argument, e.g., for a read-only property, or if
the argument is out of range, and the device may adapt it to the allowed range (this is not considered
as an error):
TX: { "out1": { "xlr2": { "gain": −100000 }}}RX: { "out1": { "xlr2": { "gain": −15 }}}
Getter-methods, which request the value of a property from the SSC Server, are realised by supplying
the special JSON value null as argument to method sent to the address of the property:
TX: { "out1": { "xlr2": { "gain": null }}}
RX: { "out1": { "xlr2": { "gain": −15 }}}
Compared to binary OSC, the JSON syntax is slightly more verbose for single attribute settings, but
this is compensated when multiple attributes are set in the same transaction:
To facilitate true interactive use, an extra-placable SSC Server is introduced as an implementation
option.
3.3 SSC JSON Message Syntax
3.3.1 Elementary data types
All SSC data is composed of the primitive JSON data types:
• string: a sequence of zero or more Unicode characters in UTF-8 encoding, wrapped in double
quotes, using backslash escapes. A character is represented as a single character string. Binary
zero bytes can be included in a string using Unicode escape notation: "\u0000".
• number: a number in conventional "scientific" notation. 0, 42, -23, 3.141259, 1.0e+100
are all valid numbers. A Restricted SSC Server MAY reject non-integer numeric arguments, or it
MAY adapt them by silently converting them to integer values.
SSC Developer‘s guide for Digital 9000 | 10/62
SSC Data Structure Specification
• true: the boolean true value.
• false: the boolean false value.
• null: indicates a missing value; used as pseudo argument for getter-methods.
The SSC Server MAY auto-convert elementary data types without further indication to their specific purpose. The client is usually informed about the actual value used by the SSC Server in the
response to the SSC method execution.
If the server auto-converts the data type, it MUST follow these conversion rules:
• string to number: String is parsed for leading whitespace, which is skipped, then for a numerical
part. Any remaining non-numerical tailing characters are ignored. Completely non-numerical
strings convert to zero. The exact behaviour MUST have the same result as calling the C standard function strtod().
• string to boolean: Any non-empty string is true, an empty string is false.
• number to string: a string representation of the number suitable for interpretation by strtod() is
used.
• number to boolean: Number zero is false, everything else is true.
• boolean to string: true results in "true", false in an empty string "".
• boolean to number: true is 1, false is 0.
3.3.2 SSC Messages
A Message is the protocol unit of transmission. Any application that sends SSC Messages is a SSC
Client, any application that receives SSC Messages is a SSC Server.
A SSC Message MUST be sent as a single closed JSON form describing a JSON object. Extra
whitespace between the elements of the message MUST be ignored by the receiver.
This means that every SSC Message is enclosed in a pair of curly brackets { }.
3.3.3 SSC Addresses
Every SSC Server implements a set of SSC Methods. SSC Methods are the potential destinations
of SSC Messages received by the SSC Server, and correspond to each of the points of control that
the application makes available. "Invoking" a SSC Method is analogous to a procedure call; it means
supplying the method with arguments and causing the method’s effect to take place. The SSC Server
MUST respond to each received SSC Message by sending a SSC Method Reply Message to the originating SSC Client.
A SSC Server’s SSC Methods are arranged in a tree structure called a SSC Address Space. The leaves
of this tree are the SSC Methods and the branch nodes are called SSC Containers. A SSC Server’s
SSC Address Space MAY be dynamic; that is, its contents and shape MAY change over time.
Each SSC Method and each SSC Container other than the root of the tree MUST have a symbolic
name which MUST be composed entirely of printable ASCII characters other than the following:
The SSC Address of a SSC Method is a symbolic name giving the full path to the SSC Method in the
SSC Address Space, starting from the root of the tree. A SSC Method’s SSC Address begins with the
character "/" (forward slash), followed by the names of all the containers, in order, along the path
from the root of the tree to the SSC Method, separated by forward slash characters, followed by the
name of the SSC Method. The syntax of SSC Addresses was chosen to match the syntax of URLs.
SSC Methods MAY be overloaded with respect to their arguments: the SSC Server may execute the
method in different ways depending on the arguments given.
SSC Methods MAY also be overloaded with respect to their Address: the SSC Server may execute
a different SSC Method instead, and reply with an SSC Method Reply to that different SSC Method
Address ("aliased" SSC Methods). Example: a wireless receiver might report the battery charge level
of the wireless transmitter either as a lifetime or as a percentage, and it might respond to a general
"battery state" SSC Method Address either by executing the lifetime or the percentage Method, depending on the circumstances.
An SSC Method may be invoked with an empty argument list by supplying the JSON null value. This
kind of SSC Method call SHOULD normally have the semantics of a query resulting in the current value of the property addressed by the method, without further side effects. SSC Methods that change
the state of an SSC Server SHOULD normally have arguments.
Example:
• query current gain of XLR2 output of OUT1 module:
3.3.4 SSC Message Dispatching and Pattern Matching
When an SSC Server receives an SSC Message, it must invoke the appropriate SSC Methods in its
SSC Address Space based on the SSC Message’s SSC Address Patterns. This process is called dispatching the SSC Message to the SSC Methods that match its SSC Address Patterns. All the matching SSC Methods are invoked with the same argument data, namely, the SSC Arguments in the SSC
Message.
The parts of an SSC Address or an SSC Address Pattern are the successive names of the JSON object
members in the SSC Method Call.
A received SSC Message must be dispatched to every SSC Method in the current SSC Address Space
whose SSC Address matches the SSC Message’s SSC Address Pattern. An SSC Address Pattern
matches an SSC Address if:
1. The SSC Address and the SSC Address Pattern contain the same number of parts; and
2. Each part of the SSC Address Pattern matches the corresponding part of the SSC Address.
A part of an SSC Address Pattern matches a part of an SSC Address if every consecutive character
in the SSC Address Pattern matches the next consecutive substring of the SSC Address and every
character in the SSC Address is matched by something in the SSC Address Pattern. These are the
matching rules for characters in the SSC Address Pattern:
1. ? in the SSC Address Pattern matches any single character
2. * in the SSC Address Pattern matches any sequence of zero or more characters
3. A string of characters in square brackets (e.g., [aeiou]) in the SSC Address Pattern matches any
character in the string. Inside square brackets, the minus sign (-) and exclamation point (!) have
special meanings:
Two characters separated by a minus sign indicate the range of characters between the
given two in ASCII collating sequence. A minus sign at the end of the string has no special
meaning.
An exclamation point at the beginning of a bracketed string negates the sense of the list,
meaning that the list matches any character not in the list. (An exclamation point anywhere
besides the first character after the open bracket has no special meaning.)
SSC Developer‘s guide for Digital 9000 | 12/62
SSC Data Structure Specification
4. A comma-separated list of strings enclosed in curly braces (e.g., {foo,bar}) in the SSC Address
Pattern matches any of the strings in the list.
5. Any other character in an SSC Address Pattern can match only the same character.
When an SSC Address Pattern is dispatched to multiple SSC Methods, the order in which the
matching SSC Methods are invoked is unspecified.
Support for address pattern matching is OPTIONAL for an SSC Server; it MAY be left out in a restricted implementation. If the SSC Server does not support address pattern matching, it MUST treat
the special pattern characters like normal characters. An SSC Client can find out whether address
patterns are supported by receiving error replies, or by calling the SSC Method /osc/feature/pattern.
3.3.5 SSC Methods addressing array values
An SSC Method MAY have an array of elementary data as value. The value array MAY be empty. The
SSC method MUST NOT switch between returning arrays and elementary data as values.
All the elements of the array SHOULD have the same elementary data type. If the SSC Method is
reflected in a corresponding /osc/limits Method, then the limits information SHOULD include the
count property to describe the array size, and all elements MUST have the same elementary data
type (see section "5.1.6 SSC Method parameter range reflection - /osc/limits" p 22).
An SSC Method that accepts an array as SSC Method Argument SHOULD also accept an elementary value, and handle it by silently converting it to an array containg that elementary value as
single element. The SSC Method Reply MUST contain the actual array in this case.
3.3.5.1 Accessing complete arrays
It MUST be possible to invoke an array-valued SSC Method in the same way as an elementary-valued Method.
An SSC Method Call with a JSON null value as argument is used to query the current state of the
property addressed by the Method. The SSC Method Reply then contains the array value.
An SSC Method Call with a JSON array as Method Argument is used to change the property addressed by the SSC Method.
An array-valued SSC Method MAY put additional requirements on the acceptable size of the array
value argument. The SSC Method Reply MAY indicate an SSC Error in this case. SSC Error Code 416
("requested range not satisfiable") MUST be used to indicate errors caused by the requested array
value size.
3.3.5.2 Combined query-and-change of complete arrays
If the array-valued argument of an SSC Method Call contains a combination of null and not-null values, the
SSC Server MUST interpret this as a query for the current value of the null-valued elements of the array
property, combined with a change of the non-null valued elements. The SSC Method Reply MUST then
state the current value of the complete array, after applying the requested changes. A restricted SSC Server MAY respond with an SSC Error 414 ("request too complex") if it does not support this kind of request.
This combined query-and-change request allows an SSC client to directly change specific elements
of an array-valued SSC Method while saving an extra Method Call to first request the current values
of array elements to keep unchanged. The first SSC Method Call of the following SSC Method transaction is only included to show all current values.
An SSC Server MAY implement an additional SSC Method Argument syntax to facilitate partially
querying and changing of array-valued SSC Methods. The OPTIONAL support of this feature is is
indicated in the SSC feature method /osc/feature/array_ranges (See also section "5.1.14.5 Support
for array range access" p 29).
Array ranges are specified by an JSON object as part of the SSC Method Arguments. This object
MAY contain the keys
• index: specifies the zero-based index of the first element of the requested array range
• count: specifies the number of elements of the requested array range
The range specification object MUST be the first element of the JSON array forming the SSC Method Argument of the SSC Method Call.
In Method Calls to query array-valued SSC Methods, the null Method Argument is replaced by an
JSON array consisting of the range specification JSON object only. The SSC Method Reply MUST
also contain the range specification inside the value array, followed by the values of the array elements in the specified range. The range specification count MUST be equal to the number of value
array elements.
An SSC Method Call to change an range of an array value also provides a JSON array as the SSC
Method Argument, which contains the range specification as the first element, followed by the values
for the array elements inside the specified range. The value for the range count MUST be equal to the
number of the value array elements.
If the specified value for index is negative, then the array range shall start at an index of array size plus the specified value (e.g., -1 indicates the last array element).
SSC Developer‘s guide for Digital 9000 | 14/62
SSC Data Structure Specification
If the specified value for count is negative, then the array range shall contain as many elements as the array size plus the specified value (e.g., -1 indicates all but one array element).
In SSC Method Replies, all values of a range specification MUST be given as positive numbers, even
if they were specified with negative values in the SSC Method Call. Thus the last array element can
be requested as follows:
The current size of the array addressed by the SSC Method can be queried by specifying an empty
array range starting at the last element. The index value given in the array range specification of the
Method Reply is one less than the array size.
If an SSC Method Call queries an array value, and specifies an array range that is not a subrange of
the actual array value, then the SSC Server MUST adapt the specified range to fit the actual array
range, in the following order:
• adapt the requested array range index to the nearest valid actual array index, i.e., either the
requested index, zero, or one less than the actual array size
• adapt the requested array range count to the nearest possible size, i.e., the requested size, or
the number of elements starting at the adapted index.
If an SSC Method Call requests to change an array value, and specifies an array range that is not
a subrange of the actual array value, then the SSC Method Reply MUST consist of a regular Reply
indicating the actual array size combined with an SSC Error 416 ("requested range not satisfiable",
see also section "5.1.2 SSC error state - /osc/error" p 19). The actual array size is indicated by an
array range specification with size zero and the index of the last array element, e.g.:
Per default, the SSC Server shall invoke the SSC Methods addressed by an SSC Message immediately, i.e., as soon as possible after receipt of the message.
An SSC Server may have access to a representation of the correct current absolute time. The optional SSC Method /device/time can be used to query and optionally set the local SSC time used by
a device. SSC does not provide a mechanism for clock synchronisation; if an SSC Server utilises a
mechanism like NTP or PTP to sync to the absolute time it should handle request to set its SSC time
by introducing a local offset from SSC time to the absolute time.
SSC Developer‘s guide for Digital 9000 | 15/62
SSC Data Structure Specification
An SSC Message may contain the SSC method /osc/timetag in addition to other methods. In this
case, the SSC Time Tag indicates the time when the SSC Server shall execute all of the methods
contained in an SSC Message. If the time represented by the SSC Time Tag is before or equal to the
current time, the SSC Server should invoke the methods immediately (unless the user has configured the SSC Server to discard messages that arrive too late). Otherwise the SSC Time Tag represents a time in the future, and the SSC Server must store the SSC Message until the specified time
and then invoke the appropriate SSC Methods.
Time tags are represented by a JSON number. The integer part of the number specifies the number
of seconds since January 1, 2000, and decimal part specifies subsecond precision. Time tags with a
value less than 31622400 (corresponding to January 1, 2001) are interpreted as a time offset relative
to the current SSC time of the SSC Server.
The actual precision that the SSC Server supports is implementation dependent; especially, it’s
allowed for an restricted SSC Server to ignore the fractional part of a time tag without raising an
error. An SSC Client may enquire the supported time precision by invoking the method /device/
timeprecision.
SSC Method Invocations in the same SSC Message are atomic; their corresponding SSC Methods
should be invoked in immediate succession as if no other processing took place between the SSC
Method invocations.
3.3.7 SSC Sessions
An SSC Session is defined by the association of a specific SSC Client with an SSC Server. The SSC
Server MAY keep state information specific to each SSC Client (e.g., state relating to SSC Method
subscriptions, or authorisation). If the SSC Server keeps such state, it MUST be coupled to the SSC
Session. When the SSC Session terminates, session state SHOULD be cleared (e.g., all SSC Method
subscriptions of the client are cancelled).
An SSC Session begins implicitly with the first SSC Method Call that a specific SSC Client sends to
an SSC Server.
The SSC Server SHOULD provide the SSC Method /osc/state/close to allow the SSC Client to actively terminate the SSC Session (see "5.1.8 SSC Session termination - /osc/state/close" p 23).
If the underlying transport protocol is based on connections (e.g., TCP/IP), then the SSC Session MUST last for the duration of the connection. The SSC Session MUST be terminated when
the connection is closed. The SSC Server MAY send an SSC Method Reply {"osc":{"state":{"close":true}}} before it terminates the SSC Session. The SSC Client MUST also consider the SSC Session as terminated if the connection is closed.
If the underlying transport protocol is not based on connections (e.g., UDP/IP), then the SSC Session MUST last for at least 60 seconds. The SSC Server SHOULD terminate the session automatically
60 seconds after the last succesful SSC Method Call. Each succesful SSC Method Call sent by
the SSC Client MUST reset the automatic SSC Session timeout interval. The SSC Client MAY call
the SSC Method /osc/ping for this purpose. The SSC Server SHOULD send an SSC Method Reply
{"osc":{"state":{"close":true}}} before it terminates the SSC Session. The SSC Client SHOULD also
consider the SSC Session as terminated 60 seconds after receiving the last SSC Message from the
SSC Server.
The SSC Server SHOULD keep state information that is explicitly specific to the SSC Session in
SSC Methods that are based in the SSC Container /osc/state, e.g., information about SSC Method
subscriptions (see"4. SSC subscriptions - /osc/state/subscribe" p 17). Additionally, SSC Server
state specific for an SSC Session MAY affect the results of calls to other SSC Methods (e.g., the
SSC Server might only allow a single SSC Client at a time, or it might provide an SSC Method for
Session authorisation, and reject other SSC Method Calls with SSC Error replies until an SSC Client
has been authorised).
SSC Developer‘s guide for Digital 9000 | 16/62
SSC subscriptions - /osc/state/subscribe
4. SSC subscriptions - /osc/state/subscribe
A subscription request is sent by a client to a server for an address pattern to subscribe to. The SSC
Server normally accepts the subscription request, and remembers that the requesting client wishes
to be notified about value changes of the subscribed addresses.
The SSC Server MAY refuse subscription requests, subject to device-specific policy or implementation specific limitations. The SSC Server MUST reply on the subscription request immediately either
by acknowledging the request, or by sending an error reply.
The SSC Server MUST send an initial subscription notification to the client, which contains the result of calling the subscribed SSC Methods immediately with null-argument when the subscription
request is handled. This initial notification MAY be bundled with the reply to the subscription request
itself.
Each subscription notification MUST have identical contents to the reply to an imagined SSC Method
invocation with null-argument to the subscribed SSC Method Address at the time that the notification is sent.
The SSC Client MAY bundle a call to /osc/xid with the subscription request. If a xid is supplied,
a reply to /osc/xid MAY be bundled with each subscription notification, with the xid of the reply
identical to that supplied by the client.
The SSC Server MUST send value changes of the subscribed addresses to the SSC Client. By default,
the SSC Server will send subscription notifications if and only if the subscribed addresses change
in value. The SSC Client can modify this behaviour by supplying optional parameters with the subscription request, allowing to either throttle the rate of notifications, or stimulate additional periodic
notifications even if the subscribed addresses do not change in value.
Every subscription is specific to the connection between SSC Client and SSC Server. Also each SSC
Method can only be subscribed once per connection. This means, that if a SSC Client requests a subscription which is already subscribed by that client on that connection, then the SSC Server MUST
treat this as if the existing subscription was silently terminated and immediately requested anew.
4.1 Subscription notification rate parameters
Optional subscription request parameters related to notification rate:
• "min" minimum notification period (ms), 0=none, default 0
• "max" maximum notification period (ms), 0=none, default 0
If "min" is 0, then notifications are not sent when a subscribed address changes in value, they are
only sent based on the "max" period. If "min" is greater than 0, notifications are sent after the specified time duration has elapsed, even if the value of the subscribed address is unchanged. If "max"
is 0, then notifications are only sent when a value changes, or based on the "min" period. If "max" is
greater than 0, then notifications are sent not earlier before the specified time duration has elapsed,
even if the subscribed address changes value in the meantime.
4.2 Subscription cancelling and expiration
The SSC Server MUST terminate a subscription in these cases:
• the subscribed client cancels the subscription explicitly
• a maximum number of notifications has been sent
• a maximum lifetime relating to the begin of the subscription expires
• the SSC Client closes the connection
• the transport layer of the SSC connection signals a communication error
If the SSC Server decides to terminate the connection because the lifetime or notification count expires, then it MUST inform the SSC Client by sending an error reply "310 – subscription terminated"
to the SSC address that terminates subscription together with or immediately after the last subscription notification.
SSC Developer‘s guide for Digital 9000 | 17/62
SSC subscriptions - /osc/state/subscribe
Optional subscription request parameters related to termination:
• "cancel" "true" cancels the subscription (default false).
• "count" maximum number of notifications to send, default 1000
• "lifetime" maximum lifetime (s) of the subscription, default 10s
The SSC Client may renew a subscription at any time, thereby resetting all of the lifetime limitations.
To renew a subscription, the SSC Client re-requests it; there’s no difference between an initial subscription request and a renewal request.
4.3 Subscribing to multiple addresses
The SSC Client MAY request multiple subscriptions in a single request; either by providing them
explicitly as SSC Address Tree, or by specifying address patterns as subscription addresses, or even
both in the same request.
The SSC Server MAY either treat all those subscription requests separately, as if the addresses had
all been requested for subscription individually. In this case all the subscription notifications would
each contain the SSC Method Reply to a single subscribed address.
Alternatively, the SSC Server MAY bundle subscription notifications which happen to be sent at the
same time into a single notification. The SSC Client MUST be able to handle a bundled notification if it
requests multiple subscriptions in a single request, but it MUST NOT rely on the SSC Server bundling
the notifications.
In any case the SSC Server SHOULD NOT bundle notification causes, meaning that the SSC Server
SHOULD NOT send any subscription notifications for addresses in a bundle with notifications to other addresses, if they would not be sent if all subscriptions had been requested individually.
If some of the SSC addresses in a subscription request must be rejected with errors, whereas other
subscriptions succeed, then the SSC Server MAY reject the request completely with an error reply
detailing all the failed addresses. If possible, the SSC Server SHOULD instead execute the successful
subscriptions and only reject the erroneous ones. This MUST result in a successful reply message to
the subscription request, with the reply value including only the successful addresses. In this case
the SSC Error state MUST be set to "210 – Partial Success", and MAY be accompanied by a parameter named "failed_addresses" with an Array of Address trees composed of all the failed Method
Addresses (erroneous Addresses replaced by {}), in bundled or unbundled representation. The value
of the Address in the Address Tree SHOULD be set to the SSC Error Code relating to the failure of the
specific Address. See also the transaction example.
The SSC Server MAY also send a SSC Error "210 – Partial Success" when in fact all of the subscriptions have failed, because the SSC Client receives sufficient information in this Error Reply to work
out this fact.
4.4 Supscription request and reply syntax
The SSC Address for subscriptions is /osc/state/subscribe.
This SSC Method may be called with a null parameter, which results in a SSC Address
tree of all addresses currently subscribed by the SSC Client on the current connection.
The SSC Method also takes a structured parameter, specified as a JSON array.
Each element of the array is a SSC Address Tree specifying the SSC addresses that the SSC Client
requests to subscribe. The SSC Address Tree MAY contain Address patterns.
A SSC Server that supports subscription MUST be able to interpret a single Address Tree element in
the Method Argument array. Multiple Address Trees MAY be supported, or the SSC Server MAY reject
them with a SSC Error 414 (request too complex).
The Response to the subscription Request will normally echo the Request, if all subscriptions can be
handled successfully. If subscription parameters were requested, then the SSC Server MAY adapt
the requested parameters, and MUST send back the adapted parameter values in the Reply. If multiple subscriptions are requested in a single Request, then the SSC Server might find it necessary to
adapt subscription parameters differently for different Addresses. In that case, the array in the Reply MAY contain additonal Address trees containing additional adapted parameter objects. The SSC
Server MAY also reject the subscription request completely (with SSC Error code 406), or partially
(with SSC Error code 210) in such a case.
SSC Developer‘s guide for Digital 9000 | 18/62
General SSC Address Schema
5. General SSC Address Schema
Some parts of the SSC address space are reserved by this specification for purposes of meta-protocol information, generic device-independent features, and device capability description.
The reserved parts of the address space are rooted in the addresses:
/osc
/device
/internal
The addresses and methods rooted in these reserved addresses are described in the following sections. This specification should be revised if additional addresses in the reserved address spaces,
or additional reserved address spaces are introduced.
The /internal address space is reserved for internal usage in the SSC Server itself. SSC Clients
MUST NOT send any requests addressing methods based in /internal, and SSC Servers MUST NOT
implement any externally callable methods.
5.1 SSC Meta Information - /osc
5.1.1 SSC Protocol version - /osc/version
Read-only value. Reports the SSC version implemented in the server.
Read-only method. Typically this method is not requested actively by the client, but the server sends
it as the SSC Method Reply to a faulty SSC Method Call. Simple example:
The error method result MUST contain an array of all the error messages resulting of all method executions in the client message.
The error method result array MUST contain as elements one or more SSC Address Trees corresponding to the method address of each faulty method execution (in the example: "/out1/xlr23", corresponding to the JSON object chain { "out1": { "xlr23": ... } }).
The value of each of the error object chains MUST be an array; this is the actual error message resulting from executing the specified method address. Typeset in **bold** in the example.
The error message MUST contain an integer numeric value, the error code. The error code SHOULD
be chosen from the list of error codes detailed below. The SSC Server MAY send different error
codes, which then SHOULD be chosen in the same spirit as the canonical error codes.
The error message MAY contain additional information about the error. This will be contained in a
JSON object, given as the second item of the error array. Exceptionally this array object has arbitrary
properties. The additional information MAY contain a human-readable description of the error; this
MUST be sent as a string value for the property named desc (for "description"). The additional error
information MAY contain other properties intended for debug or service purposes,
or future protocol extensions. The SSC Client MUST ignore any properties that it does not know.
If the SSC Server sends a non-canonical error message, it SHOULD supply human-readable "desc”
information as well, because the SSC Client can’t be expected to react in any specific way to an
unknown error, other than to relay the description to the user.
The language of any error description MAY depend on the optional /device/language setting.
The following complex example shows how an SSC Message containing three SSC Method calls is
answered, where two methods fail and one succeeds:
SSC Developer‘s guide for Digital 9000 | 19/62
Loading...
+ 43 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.