Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Служба CAN предназначена для управления конфигурацией сети CAN.

Управление конфигурацией сети CAN возможно при наличии разрешения "can" или "all" в профиле пользователя, выполняющего запрос.

Управление осуществляется следующими командами в поле "querrytype":

getcan - получить информацию о стыке CAN. Дополнительные параметры:

  • k - идентификатор сессии пользователя;
  • if - имя стыка CAN ("can0" или "can1").

Ответ содержит информацию о состоянии модуля, а также о подключенных и сконфигурированных устройствах (если они есть), и имеет видThe CAN service is designed to manage the CAN network configuration.

CAN network configuration management is possible with the permission "can" or "all" in the profile of the user performing the request.

Management is carried out by the following commands in the "querrytype" field:

getcan - get information about the CAN interface. Extra options:

  • k - user session ID;
  • if - the name of the CAN interface ("can0" or "can1").

The answer contains information about the status of the module, as well as about the connected and configured devices (if any), and looks like this:

<can if="can1" state="up" mode="normal" timestamp="1981" >
<device node_id="1" vid="781" pcode="VT470
(1)" desc="Motion, vibration, temperature" rev="0.01" sn="217" state="operational" />
</can>

 Где, значение атрибутов узла canWhere, the value of the attributes of the node can are:

  • state - состояние стыкаinterface state: 
    • "up" - интерфейс в работеthe interface is in operation;
    • "down" - интерфейс отключенthe interface is disabled;
  • mode - режим работыoperating mode:
    • "normal" - режим измеренийthe measurement mode;
    • "config" - режим конфигурацииconfiguration mode;
  • timestamp - время последнего обновления информации о стыке (формат the time of the last update of the information of the bus (format Unix Time Stamp).

Значение атрибутов узла deviceThe value of the attributes of the device node:

  • node_id - Node ID, идентификатор нодыnode identifier;
  • vid - Vendor ID, идентификатор производителя устройства CANthe identifier of the manufacturer of the CAN device;
  • pcode - Product Code, тип устройства CAN device type (цифровой кодdigital code);
  • rev - Revision, ревизия программного обеспечения устройства CANrevision of the CAN device software;
  • sn - Serial Number, серийный номер устройства CANserial number of the CAN device;
  • state - текущее состояние устройстваthe current state of the device;
  • desc - описание подключенного устройстваdesc - description of the connected device.


deldevicecan - удалить устройство из конфигурации стыка CAN. Дополнительные параметрыremove the device from the CAN interface configuration. Extra options:

  • k - идентификатор сессии пользователяuser session ID;
  • if - имя стыка CAN bus name ("can0" или or "can1");
  • node_id - идентификатор ноды устройства на стыке CAN node identifier of the CAN interface (1..127).

savecan - сохранить конфигурацию для стыка CAN. Дополнительные параметрыsave configuration for CAN interface. Extra options:

  • k - идентификатор сессии пользователяuser session ID;
  • if - имя стыка CAN the name of the CAN interface ("can0" или or "can1").

ctlcan - управление стыком CAN interface control. Дополнительные параметрыExtra options:

  • k - идентификатор сессии пользователяuser session ID;
  • if - имя стыка CAN bus name ("can0" или or "can1");
  • mode - режим работы демона низкого уровня. Возможные значенияthe operating mode of the low level daemon. The possible values ​​are:
    • normal - переводит стык в режим нормальной работыmoves the bus into normal operation mode
    • config - переводит стык в режим конфигурированияputs the bus into configuration mode
    • restart - рестарт демона низкого уровня (при изменении файла конфигурации).

Конфигурирование устройств на шине

...

    • restart the low-level daemon (when the configuration file is modified).

Configuring devices on the bus

The "ctlcan" command, with the "mode=config" field, puts the corresponding module into the search and configuration mode for the devices connected to the bus. The configuration process takes some time, the more connected devices, the longer it takes to configure them. The module state can be checked by the "getcan" command, using "mode" field in the response, until it returns value "config" to "normal" value. At the same time, if devices were detected, such modules must and will be included as operational, i.e. field "state=up".