getINDI(1)

NAME
getINDI - get INDI property values

SYNOPSIS
getINDI [options] [device.property.element ...]

DESCRIPTION

getINDI connects to an indiserver and reports the current value of one or more properties. Each property is specified using three components in the form:

    device.property.element

Any component may be an asterisk, "*", to serve as a wild card and match all properties in that component of the specification. If no property is specified, then all properties match, ie, it is as if the specification "*.*.*" were given.

The last component of the property specification is usually the element name, but may be a reserved name to indicate an attribute of the property as a whole. These reserved names are as follows:

_LABEL
    report the label attribute

_GROUP
    report the group attribute

_STATE
    report the state attribute

_PERM
    report the permission attribute

_TO report the timeout attribute

_TS report the timestamp attribute

OPTIONS

-1  print just the value if expectiong exactly one matching property

-d <f>
    use file descriptor f already open as a socket to the indiserver. This is useful for scripts to make a session connection one time then reuse it for each invocation. If the file descriptor seems to be being closed, check that the close-on-exec flag is off; for example in perl use something like:
    #!/usr/bin/perl
    use Socket;
    use Fcntl;
    socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
    connect(SOCK, sockaddr_in(7624,inet_aton('localhost')));
    fcntl(SOCK,F_SETFD,0);
    $directfd = fileno(SOCK);
    %props = split (/[=/, `getINDI -d $directfd`);

-h <h>
    connect to alternate host h; the default is localhost.

-p <p>
    connect using alternate port p; the default is 7624.

-t <t>
    wait no longer than t seconds to gather the values for all the specified properties; the default is 2 seconds.

-v  generate additional information on stderr. This is cumulative in that specifying more -v options will generate more output.

OUTPUT FORMAT
The output of getINDI is one line per property. Unless the -1 option is given, each line is of the form:

    property=value

EXIT STATUS
The getINDI program exits with a status of 0 if it suceeded in finding the value for each specified property. It exits with 1 if there was at least one property for which no value was found within the given timeout period. It exits with 2 if there was some other error such as not being able to connect to the indiserver.

EXAMPLES

In a perl script, gather all properties for the default indiserver and save them in an associative array %props which can then be used to look up a property value by name:

    %props = split (/[=/, `getINDI`);

Wait up to ten seconds to get the values of all properties from the Mount device on the given host and non-standard port:

    getINDI -h indihost -p 7655 -t 10 "Mount.*.*"

Print just current value of the wind speed element from the weather device:

    getINDI -1 Weather.Wind.Speed

SEE ALSO

evalINDI, setINDI, indiserver
http://www.clearskyinstitute.com/INDI/INDI.pdf