ditscmd - Sends a command to a Dits task and waits for the response.

Function

Sends a command to a Dits task and waits for the response.

Description

This program provides a simple user interface to a Dits task. It first gets the path to the specified Dits task and sends an obey message with the specified name and arguments. It waits for the response, outputting the details of any Error for Informational messages received from the task. When the subsidiary action completes, DITSCMD exits, returning the completion status of the subsidiary action.

Synopsis

ditscmd [options] task action [action_arguments ...]

Under VxWorks, all options and arguments should be enclosed in the one string.

Command arguments

task
The name of the task to send the message to. If a remote task use the format task@node, where node is the internet node name of the machine the task is running on.
action
The name of the action or parameter to in the task

action_arguments
All other arguments are considered arguments to the task, and are encoded as character strings in an argument structure. If the string contains an equals sign, it is assumed that the characters before the equals sign are the parameter name, and the characters after are a string value. Otherwise each argument has the name
                           Argument
Where <n> is the number of the argument, starting at 1. The -z option can be used to change the equals sign to something else.

If doing a parameter get operation, the arguments are names of extra parameters to fetch.

Options

-b size
Depreciated. Size is the total message buffer size. Default 15000. This size should be about 50% bigger then that required by the reply values specified by the "-m" option. Ths is now sized automatically if you change the reply buffer sizes - the relevant part of the "-m" spec. In that case the global buffer will always be set to be at least large enough to set up the reply buffer.

-m n1:n2:n3
Sets message buffer sizes for the connection. n1 = Messages bytes allowed for message to be sent n2 = Messages bytes allowed for return messages n3 = Number of return messages which may occur Default is 800:800:10 which should be sufficient for most command line level tasks. The first item is actually overriden to a size appropiate for the argument to be sent - its use here is historical. (This argument is currently ignored under VxWorks)

-n name
The name this task should register itself as. Default is DITSCMD_<n> where <N> is a hex representation of the process id. This option may be required if you intend to have several versions of this program outstanding at one time.

-o
Send obey message (default).
-k
Send kick message.
-s
Send set message.
-g
Send get message. (Actually multiple parameter get message, but this works ok one only one parameter is specified).
-c
Send control message.
-p
Send parameter monitor message.
-l
Send multiple parameter get message (redunant, you should use -g).
-v
Report reponses verbosely using SdsList, not briefly using ArgToString. Overides any -w option.
-w
Write any returned Sds structure to the file ditscmd_out.sds. Overrides any -v option. On successfully completion program will exit quietly after writing the file.
-a <file>
Read the obey arguments from the specified file rather then the command line. Non-VxWorks versions only. Any extra arguments will cause an error.
-z <c>
Change from using "equals" in the Name=value argument naming convention to using the specified character. Only the first character of the value is used.
-x
If the sub-task exits, then don't return an error code from this program.
--
Stop processing options. You will need to use this if your arguments contain negative numbers or other values prefixed by a dash.
-h
Output help on this program.

Language

C

Support

Tony Farrell, AAO

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tjf@aao.gov.au