![Infomir MAG-200 Скачать руководство пользователя страница 23](http://html1.mh-extra.com/html/infomir/mag-200/mag-200_operators-manual_2058022023.webp)
MAG-200 Operator Guide Rev 1.05.
Device control variants
The device offers the possibility to the operator to realize various algorithms of
the device control. Among them: sending commands to the device via a multicast
group, sending commands via JavaScript API. Because the system is open there is a
possibility of adapting various own control and monitoring systems.
Sending and handling operator command using a multicast group.
The device program contains the utilities dsign, mcsend
и
mcrec allowing the
realization of the algorithm for sending and receiving commands from the operator to
the device using a multicast group.
The whole process consists of the following stages:
1. Creation/preparation
of
the operator commands file;
2.
Creation of digital signature using the operator key with the utility gpg;
3.
Transfer of the signed file containing operator commands via a multicast group;
4.
Receiving data on the device from the multicast group;
5.
Checking digital signature of the data received in the file with the utility
dsign
;
6.
/usr/bin/cmd_parse.sh start for each operator command with the name of the
command specified by the operator assigned thereto as the first parameter; the second
parameter contains the name of the file, in which the “command parameters” are
stored.
Let us consider the variant of sending the command for restarting the device. It
is performed using the file reboot.sh. It forms a temporary file with the command on
restart and sends the file name as the parameter to cmd_send.sh. This command
creates the digital signature and sends the resulting file to the multicast group
IP_CMD:PORT_CMD (224.10.0.52:9002) with the uility
mcsend
. If the parameters
TeleTec.mcip_mng, TeleTec.mcport_mng in dhcp-answer are specified on the device,
the operator commands are expected from this multicast group. The data received are
stored in then temporary file, the signature is checked and cmd_parse.sh is called.
The cmd_parse.sh determines that the first parameter has the value Reboot and
reboot is performed, which results in restarting the device.
Adding own commands by operator.
Based on the above the addition of the operator command TestComand
assumes the creation of the file on the server testcomand.sh (similar to reboot.sh):
cmd=./tmpcmd
23