H MP Co n f igu ra tio n AP I - S p in e tiX Te ch n ica l Do cu me n ta tion v3 .1
© S p in e tiX S A A ll rig h ts re se rve d .
P a g e 9 of 5 8
Notes
The XML configuration string can reflect a full configuration of the HMP device (as it is the
case for when the configuration backup is generated from HMP Control Center), or it can
update only a limited number of settings (in this case, the settings not found in the
configuration string will keep their current value).
The XML configuration string can be used either as the content of the config.xml file (which
gets included into a configuration backup) or as the value of the
xmlconfig
parameter of the
set_config()
RPC command (in this case make sure to properly encode the XML string).
A configuration command is an XML element in the XML configuration string. It may be single
XML element, an XML element containing some text content parameters, or a more complex
XML structure to modify more than one parameter with a single command.
The next chapter
describes in detail all the available configuration commands.
Compatibility
Some configuration may be compatible both with version 1.2 and 2.0 has they only use command
present in both version and based on the same syntax. In this case it is possible to indicate to a device
based on version 2.0 that it should also accept the configuration. This can be done using the
compatible
attribute.
<?xml version="1.0"?>
<configuration version="1.2" compatible="2.0">
<command-1>...</command-1>
...
<command-n>...</command-n>
</configuration>
Example
The XML configuration string below sets the aspect ratio of the screen to 16:9 and its orientation to
horizontal. Finally, it forces a reboot of the HMP to apply the changes. No other parameters are
modified.
As the configuration is compatible with both version 1.2 and 2.0, the compatible attribute is used.
<?xml version="1.0"?>
<configuration version="1.2" compatible="2.0">
<screeen-aspect-ratio>16:9</screeen-aspect-ratio>
<display-orientation>horizontal</display-orientation>
<reboot/>
</configuration>
Order of execution
The configuration commands are executed in the order provided within the XML configuration string.
Since different configuration commands can control the same HMP feature, the order in which they
are provided influences the end result.