Respond Command


Applications can invoke two EnOS open APIs to send control commands to devices in EnOS, namely the Set Measurement Point and Invoke Service APIs. The Respond Command node updates the status of these commands.

Node Type

EnOS.

Input and Output Ability

This node has multiple entry points and 1 exit point. Both the input and the output are JSON.


The data structure of the command is according to the standard data format for EnOS device access. For more information, see Get Command API.

Node Properties


../../_images/respond_command.png


Name

The name for this node.


Description

The description for this node.

Limitations


The command structure needs to follow the EnOS standard format.

Samples


The parameter description in the input and output messages are as follows:

  • commandId: The command ID.
  • code: The status of the command. When the code value is 0 or 200, it indicates that the command status is updated as “success”. If it has another value, it indicates that the command status is updated as “failure”.
  • message: The device response message to the command.
  • outputId: The ID of the service output parameter specified in the input message. This is only required when the command type is Invoke Service.
  • outputData: The key-value pairs of the service output parameters specified by outputId. This is only outputted when the command type is Invoke Service.

Command Type: Set Measurement Point

Input Sample


{
    "commandId": "2078724684846989312",
    "code":"200",
    "message":"message",
    "data": {}
}

Output Sample


{
    "commandId": "2078724684846989312",
    "code":"200",
    "message":"message",
}

Command Type: Invoke Service

Input Sample


{
    "commandId": "2078724684846989312",
    "code":"200",
    "message":"message",
    "data": {
        "outputId": 321
        }
}

Output Sample


{
    "commandId": "2078724684846989312",
    "code":"200",
    "message":"message",
    "outputData": {
            "parameter_1": 1.3,
            "parameter_2": 13
        }
}