Sending a command, receiving value
Commands used for Catchbox devices can be divided into three groups - set value, get value, and subscribe to one or multiple values. Commands are sent and values are received as JSON strings.
As noted above, JSON is used for communication between your application and the Catchbox device as it has native implementations in many programming languages.
Here is a sample command that requests the Dante MAC address from the Catchbox Hub. You can identify that this is a get
command as the mac
attribute is set to null
. As you will notice in the commands list file this is a convention used for all of the API get
commands.
A sample response for the command above would look like this
As you can see the object returned is almost identical with sent command except for returning the data requested and adding an error
parameter to the root object to notify the user of any errors that might've happened.
An example of a set
command could be this
The command would change the name of the Catchbox Hub to "new name".
Please take note of the min-max values for each command as well as their data type. These can be viewed on the command list section.
If the min-max values are 0 and 1, most likely they represent a setting that can be turned off or on respectively.
Notice when changing the device network settings
When changing the network settings of the device, such as IP address, IP mode, subnet mask, or gateway it is neccessary to issue a reset command for the changes to take effect.