The api protocol – Grass Valley K2 Edge Protocol Manual v1.0 User Manual

Page 9

Advertising
background image

K2 Edge Protocol Manual – document version 1.0 – Page 9

3.9. The API protocol

The nexos socket server supports a number of different services, the most important being the complex

service. The complex service implements the K2 Edge API protocol. This protocol supports a group of

commands that allow control over many of the nexos playout features. For example, using K2 Edge API

commands, clips and animations can be preloaded and started at a given time, GPIO ports can be

triggered and Channel Composer templates can be preloaded and launched.

The K2 Edge API protocol uses the complex string format as the 'language' to communicate messages,

instead of binary data. The simple ASCII format allows one or more field-value pairs to be placed in a

string between curly braces. Each pair is terminated with a semicolon.

API commands sent to the nexos socket server using the complex service share the following features:

1. They all follow the Complex String Format syntax.

2. They all have a field called 'cmd' where the value defines the command name. (Most commands use

more than just one field-value pair though.)

For example, for the ping command, it looks like this:

{cmd=ping;}

This is a simple command with just one field-value pair, in this case the mandatory cmd field with value

ping. Note the terminating semi-colon after the value bit, and the enclosing curly braces. To send this

command to nexos using the complex service, to channel #0 and layer #4 and following the layout

described above:

nex: 0 4 complex {cmd=ping;}\n

The Complex String Format is described in more detail in the appendix.

Advertising