TensorCommon.xid 5.71 KB
<?xml version="1.0" encoding="UTF-8" ?>

<!--
  Copyright (c) 2017, TeleCommunication Systems, Inc.,
  a wholly-owned subsidiary of Comtech Telecommunications Corp.
  and/or affiliates of TeleCommunication Systems, Inc.
  All rights reserved.
  TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
  Use is subject to license terms included in the distribution.
-->

<specification xmlns="http://xid.location.studio/XID/XtensibleInterfaceDefinition.xsd"
               xmlns:xid="http://xid.location.studio/XID/XtensibleInterfaceDefinition.xsd"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://xid.location.studio/XID/XtensibleInterfaceDefinition.xsd XtensibleInterfaceDefinition.xsd"
               identity="TensorCommmon.xid">
    <title>Tensor Commmon Definitions</title>
    <comment></comment>
    <artifact></artifact>

    <import ref="TensorDefinitions/V1.0.0/TensorDefinitions.xid" local="TensorDefinitions.xid" />

    <namespace name="Tensor">
      <struct name="NameValue" >
        <comment>A string base name value pair entry.</comment>
        <elem name="name" type="Tensor.string"/>
        <elem name="value" type="Tensor.string"/>
      </struct>

      <enum name="ResultCode" type="Tensor.int8" default="undefined">
        <comment>General processing result codes.</comment>
        <literal name="success" value="1"/>
        <literal name="undefined" value="0"/>
        <literal name="failure" value="-1" />
        <literal name="busy" value="-2" />
        <literal name="notprocesssed" value="-3"/>
      </enum>

      <struct name="VoidType">
        <comment>Reserved type used in various translations to preserve translation. It has no purpose but as a placeholder.</comment>
        <elem name="reserved" type="Tensor.uint16" multiplicity="1"/>
      </struct>     
      
      
      <!--
      ************************************
      * Command API Implementation
      ************************************
      -->
      <struct name="Command">
        <comment>A TPF command structure compatible with the TPF Framework Commander Component.</comment>
        <elem name="name" type="Tensor.string" multiplicity="1">
          <comment>The command name including scope specifiers.  Convention is to use a '.' as a scope separator
          such as[component name].[command name].</comment>
        </elem>

        <elem name="etid" type="Tensor.string" multiplicity="0..1">
          <comment>
            Optional external transaction identifier for the caller to uniquely identify and track
            the command and corresponding results.
          </comment>
        </elem>

        <elem name="argument" type="NameValue" multiplicity="0..*">
          <comment>
            Each command may have zero or more arguments.  
            They may be name/value or oridinal/value arguments. 
            Both name and value are required.
          </comment>
        </elem>
      </struct>

      <struct name="CommandResponse">
        <comment>
          The command response structure containing information resulting from executing the 
          command (success or failure).   Check the result code for details on status of executing the 
          command a value of 1 means success, value of 0 is undefined, See ResultCode for other standard
          result codes.  Each operation may define additional codes.
        </comment>
        <elem name="name" type="Tensor.string" multiplicity="1">
          <comment>
            The command name including scope specifiers.  Convention is to use a '.' as a scope separator
            such as[component name].[command name].
          </comment>
        </elem>
        <elem name="result" type="Tensor.int8" multiplicity="1">
          <comment>The processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
        </elem>

        <elem name="etid" type="Tensor.string" multiplicity="0..1">
          <comment>
            Optional external transaction identifier for the caller to uniquely identify and track
            the command and corresponding results.
          </comment>
        </elem>

        <elem name="output" type="Tensor.string" multiplicity="0..1">
          <comment>
            Optional command output stored as a string.  Interpeting the output data is dependent upon the
            command function executed and what data formats are as an encodded string.
          </comment>
        </elem>
      </struct>

      <interface name="CommandApi">
        <comment>Interface executing commands inside TPF Containers.</comment>

        <operation name="Execute">
          <comment>
            Executes the specified command elements. Can specify whether to return responses (default true) or not using wantresponses.
          </comment>
          <input name="input" sid="0x0100">
            <elem name="commands" multiplicity="1..*" type="Command"/>
            <elem name="wantresponses" multiplicity="1" type="Tensor.bool" default="true"/>
          </input>
          <output name="output" sid="0x0101">
            <elem name="lastcommand" type="Tensor.int8" multiplicity="1">
              <comment>The index of the last command executed. If this is less than the total number of commands a failure occurred.</comment>
            </elem>
            <elem name="lastresult" type="Tensor.int8" multiplicity="1">
              <comment>The last processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
            </elem>
            <elem name="responses" type="CommandResponse" multiplicity="1..*">
              <comment>A command response for each command executed.</comment>
            </elem>
          </output>
        </operation>
      </interface>
    </namespace>
</specification>