Return values

From XDIF

Jump to: navigation, search

This is part of OSC Plug And Play.

Contents

Draft

Return values are sent to "/osc/reply" and contain the queried url:

Query:

/foo/bar 1.5

Reply:

/osc/reply "/foo/bar", 1.2

Agreed standard

OSCit

In OSCit, return values are sent back to a well known url and contain the requested url:

query: /foo/bar 12.3
reply: /.reply "/foo/bar" 10

The example above shows a case where the value has been clipped to '10'.

All observers (those who asked for notification) receive this reply except when an error occurred in which case only the client receives the reply.

typetags used in OSCit

NIL          = 'N'
REAL         = 'f'
TRUE         = 'T'
FALSE        = 'F'
STRING       = 's'
ERROR        = 'E'
HASH         = 'H'
MATRIX       = 'M'
MIDI_MESSAGE = 'm'
ANY          = '*'
ARRAY_START  = '['
ARRAY_END    = ']'

The TRUE typetag is used as impulse. We could replace it with "I".

The "ANY" typetag will be removed (it was used in "/.type" replies but will not be needed with the new string based type identifier).

The HASH typetag is a dictionary of key/value pairs encoded in JSON (it's just a string that the parser knows to be json). This typetag could be replaced with a more generic "J" for JSON since the OSCit library uses a JSON parser internally anyway.

The Hash is currently used to update Json encoded views stored on the device. It makes it easy for a device to "merge" the hash with the new values.

AVBC

The return values contain the same url as the query and are sent to the socket from which the request originated:

 TX: [ "/input/level" ,i (input #) ]
 RX: [ "/input/level" ,if (input #) (current value) ]

In order to support such semantics, the socket to send requests must be different from the one listening to requests.

Personal tools