Result of Asynchronous Command Execution

Result of Asynchronous Command Execution

{
    "event": "command_result",
    "id_cmd": id,
    "status": "finished" | "timeout",
    "parameters": {cmd_info},
    "result": {result_info}
}

Here:

  • id_cmd – the ID of the previously executed command (integer nonzero value
    returned by the function of XxxAsync(…) command running.

  • status – the command was executed successfully or was aborted when the timeout period elapsed.

  • parameters – JSON object: the parameters with which the command was run.
    The command (the command name) and timeout (timeout set at the command running) fields are obligatory.
    Also, the parameters will contain the parameters set at the command running:

    {
        "command": "command_name",
        "timeout": T,
        ...
    }
  • result – JSON object with the result of the command execution (unless the timeout period elapses).
    Contains the obligatory error field indicating whether the command was successful (error=OK) or not.
    Refer to the description of the specific command to know the specific error codes and their meanings.
    The description of the additional result fields depends on the specific command as well.

    {
        "error": "error_code",
        ...
    }

Error codes general to all commands

  • “OK” – executed successfully
  • “TRY_LATER” – the command cannot be currently executed, try later.