Specifications
Shared Variables
99
AMX InspiredSignage XPress Programming Guide
Network API
Framing
The network protocol for the distribution of notifications is based on a stream of variable length commands
sent over a TCP socket. Individual commands are separated by the \r\n (0x0D 0x0A) two-byte sequence. This
sequence should not happen inside the command.
When string parameters are used, they are put between double quotes. Special characters should be escaped, in
a manner similar to C-string constants, with a backslash sequence. The following characters must be escaped:
newline (0x0A) with \n
carriage return (0x0D) with \r
double quote (0x22) with \"
null byte (0x00) with \0
backslash itself with \\
Alternatively, the network API also supports setting shared variables via an HTTP GET request. This method
does not allow persistent connections, but it is easier to access from a client scripting language supporting the
XMLHttpRequest API, like JavaScript in web browsers. Whenever a GET request is issued, the connection by
the server is closed immediately after the response has been sent.
The HTTP GET interface supports only the 'UPDATE' and 'EVENT' commands.
List of commands
Network API Commands
UPDATE Syntax:
UPDATE [timestamp] “name” “value”\r\n
Used to send or receive updates. The timestamp is the number of microseconds
since Jan 1st 1970 UTC.
The timestamp may be omitted, in which case the server will use the time the com-
mand is received as the timestamp.
It is only possible to send an 'UPDATE' command to an IS-SPX-1000 if the network
API is enabled. Note that no response is sent back by the server.
Please note that the protocol is case sensitive, so the word UPDATE must be in
capital letters.
Example:
GET / UPDATE?name1=value1&name2=value2... HTTP/1.0\r\n
\r\n
Used to send an update for one or more shared variables. The URL is also case
sensitive, but the update must be lower case in this instance. It is not possible to
specify a timestamp with this interface.
Instead of opening a TCP socket and managing the low level protocol, you can get a
web browser to send the request by entering the address below:
http://[server]:[port]/update?name1=value1&name2=value2...