.. _SystemIntegration_HandlingDevices: ####### General ####### Important definitions ********************* The following definitions will occur in the communication with the devices: * **deviceId** : id of the device .. _SystemIntegration_HandlingDevices_DeviceState: Get device state **************** This method is used to check if the device is enabled and online. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the device. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/state **Example request**: .. sourcecode:: http GET /hal/devices/smartonemodule1/state HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "statusId": 1, "powerStatusId": 2001, } :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json integer statusID: see :ref:`DCOStatus ` :>json integer powerStatusID: see :ref:`PowerStatus ` .. _SystemIntegration_HandlingDevices_DeviceInfo: General info of the devices *************************** Get device info ================ This method is used to retrieve more information about the device's hardware, firmware and configuration . **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the device. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/info **Example request**: .. sourcecode:: http GET /hal/devices/payter1/info HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "deviceId": "payter1", "name": "payter 1", "hardwareType": "APO01.BL.TST V1-1", "hardwareVersion": "", "firmwareVersion": "", "type": 15, "connectionState": 1, "enabled": true, "nodeId": "0", "serialNumber": "" "channelType": 2, "channelName": "192.168.0.10:3201" } :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json string deviceId: id of the device :>json string name: user friendly device name :>json string hardwareType: hardware type of the device :>json string hardwareVersion: hardware version of the device :>json string firmwareVersion: firmware version of the device :>json integer type: device type (see :ref:`device types `) :>json integer connectionState: connection state of the device. Possible values: 1 (connected), 0 (disconnected) :>json boolean enabled: indicates whether the device is enabled or not :>json string nodeId: nodeId of the device in the fieldbus network :>json string serialNumber: serial number of the device :>json integer type: channel type (see :ref:`channel types `) :>json string type: channel name Get device info for one or more devices ======================================== This method is used to retrieve more information about the device's hardware, firmware and configuration of all or one or more devices. **URL parameters** * **hostIp**: Ip address of the API host. * **nodeId** (optional): NodeId of the device in the fieldbus network .. http:get:: https://{hostIp}:7081/hal/devices/info?nodeId={nodeId} **Example request**: .. sourcecode:: http GET /hal/devices/info?nodeId=11:22:33:44:55:66 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 [ { "deviceId": "OAIII_1", "name": "OAIII 1", "hardwareType": "", "hardwareVersion": "", "firmwareVersion": "", "type": 17, "connectionState": 1, "enabled": true, "nodeId": "11:22:33:44:55:66", "serialNumber": "" "channelType": 8, "channelName": "hciO" } ] :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array info: array of device info of devices matching the query parameters 'nodeId'. See :ref:`"get device info" ` for more info about device info. Test device connectivity ************************ This method can be used to test the device connectivity **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the device. .. http:post:: https://{hostIp}:7081/hal/devices/{deviceId}/testconnectivity **Example request**: .. sourcecode:: http POST /hal/devices/payter1/testconnectivity HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "testResults": [ { "id": 100, "result": 1, "description": "Check if device task manager is running", "message": "", "index": 0 }, { "id": 201, "result": 1, "description": "Check if communicationchannel 10.5.0.132:3201 is opened", "message": "", "index": 1 }, { "id": 800, "result": 1, "description": "Checking system info of payter device pt1", "message": "SerialNumber: APO20230900366, Model: APO01.BL.TST V1-1, Platform: apollo/1.1.2-b158/Test", "index": 2 } ] } :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array info: an array of performed tests is returned containing the following fields for each performed test: :>json int id:id of the test (see :ref:`channel types `) :>json int result: result of the test (0 = not performed/skipped, 1 = success, 2 = failed, 3 = warning) :>json string description: a short description of the performed test :>json string message: extra information gathered while performing the test :>json int index: following order of the performed test Direct Commands *************** Direct commands are not device agnostic. The supported commands and their corresponding parameters and returns values depend on the device type. Go the Supported direct commands topic of a specific device in :ref:`supported devices ` to learn more about the supported commands for a specific device. **URL parameters** * **hostIp**: ip address of the API host. * **deviceId**: id of the device. * **commandId**: id of the direct command. .. http:post:: https://{hostIp}:7081/hal/devices/{deviceId}/directcommand/{commandId} **Example request**: .. sourcecode:: http POST /hal/devices/oa3/directcommand/2 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json { "passkey": 123456, } **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error Direct Queries ************** Like Direct commands, Direct Queries are also not device agnostic. The supported queries and their corresponding parameters and returns values depend on the device type. Go the Supported direct queries topic of a specific device in :ref:`supported devices ` to learn more about the supported queries for a specific device. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the device. * **queryId**: id of the direct query. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/directquery/{queryId} **Example request**: .. sourcecode:: http GET /hal/devices/oa3/directquery/1 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "binStatus": 1, "isTrusted": true, "isPaired": true, "isBonded": true } :statuscode 200: OK :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json JObject object: go to the direct queries topic of a specific device in :ref:`supported devices ` Enumeration values ****************** .. _SystemIntegration_HandlingDevices_DCOStatus: Enumeration DCOStatus ===================== * Enabled = 1 * Disabled = 7 .. _SystemIntegration_HandlingDevices_PowerStatus: Enumeration PowerStatus ======================= * Unknown = 0 * Online = 2001 * Offline = 2004 .. _SystemIntegration_HandlingDevices_DeviceTypes: Enumeration DeviceTypes ======================= * AP286 = 0 * DBK = 1 * STID = 2 * AP338 = 4 * AP298 = 5 * AP3010 = 6 * SmartOne = 7 (EOL) * SmartCover = 8 (EOL) * SmartCardReader = 9 * BarcodeScanner = 10 * UvcWebcam = 11 * WutWebIO = 12 * AvutecANPR = 13 * RGBTechnologyDisplay = 14 * PayterApollo = 15 * RPI4Gateway = 16 * OAIII = 17 * SuloWeighingBin = 18 * WHBerlinCoinAcceptor = 19 * RPI4GatewayDisplay = 20 .. _SystemIntegration_HandlingDevices_ChannelTypes: Enumeration ChannelTypes ======================== * CAN = 1, * TCPIP = 2 * SERIALPORT = 3 * PCSC = 4 * UVC = 5 * UDPIP = 6 * DIGITALIO = 7 * BLE = 8 * WEB = 9 * DISPLAY = 10 .. _SystemIntegration_HandlingDevices_TestIds: Test Ids ======== * ID_UNKNOWN = 0 * ID_MANAGER_RUNNING = 100 * ID_CHANNEL_EXISTS = 200 * ID_CHANNEL_OPEN = 201 * ID_MOXA_CONFIG = 300 * ID_ICMP_PING = 301 * ID_MOXA_LAUNCHER = 302 * ID_MOXA_PORT = 303 * ID_GEN2_DEVICE_CHECK_ADDRESS = 400 * ID_GEN2_DEVICE_CHECK_APP = 401 * ID_GEN2_DEVICE_CHECK_BOOTLOADER = 402 * ID_GEN2_DEVICE_CHECK_SCRIPT_SETTINGS_VERSION = 403 * ID_OSDP_DEVICE_CHECK_ID_REPORT = 500 * ID_ELKA_CHECK_DEVICE_INFO = 600 * ID_CHECK_OPCUA_SERVER_INFO = 700 * ID_CHECK_PAYTERS_IDS_INFO = 800 * ID_GWIO_CHECK_IO_ACCESS = 900 * ID_GWIO_CHECK_IO_STATUS = 901 * ID_GWIO_CHECK_SCREEN_STATUS = 902 * ID_BLE_CHECK_ADAPTER_INFO = 1000 * ID_BLE_CHECK_DEVICE_INFO = 1001 * ID_CHECK_OAIII_INFO = 1100 * ID_WEB_CHECK_DOMAIN = 1200 * ID_WASTEDROPAPI_PING = 1300 * ID_WASTEDROPAPI_CHECK_CONTAINER = 1301 * ID_CCTALK_DEVICE_INFO = 1400