indi_eval -V (return code: 2)
Compile err: Bad function near `version'
indi_eval -h (return code: 1)
-h requires host name
Usage: indi_eval [options] [exp]
Purpose: evaluate an expression of INDI operands
Version: $Revision: 1.5 $
Options:
-b : beep when expression evaluates as true
-d f : use file descriptor f already open to server
-e : print each updated expression value
-f : print final expression value
-h h : alternate host, default is localhost
-i : read expression from stdin
-o : print operands as they change
-p p : alternate port, default is 7624
-t t : max secs to wait, 0 is forever, default is 2
-v : verbose (cummulative)
-w : wait for expression to evaluate as true
[exp] is an arith expression built from the following operators and functons:
! + - * / && || > >= == != < <=
pi sin(rad) cos(rad) tan(rad) asin(x) acos(x) atan(x) atan2(y,x) abs(x)
degrad(deg) raddeg(rad) floor(x) log(x) log10(x) exp(x) sqrt(x) pow(x,exp)
operands are of the form "device.name.element" (including quotes), where
element may be:
_STATE evaluated to 0,1,2,3 from Idle,Ok,Busy,Alert.
_TS evaluated to UNIX seconds from epoch.
Switch vectors are evaluated to 0,1 from Off,On.
Light vectors are evaluated to 0-3 as per _STATE.
Examples:
To print 0/1 whether Security.Doors.Front or .Rear are in Alert:
evalINDI -f '"Security.Doors.Front"==3 || "Security.Doors.Rear"==3'
To exit 0 if the Security property as a whole is in a state of Ok:
evalINDI '"Security.Security._STATE"==1'
To wait for RA and Dec to be near zero and watch their values as they change:
evalINDI -t 0 -wo 'abs("Mount.EqJ2K.RA")<.01 && abs("Mount.EqJ2K.Dec")<.01'
Exit 0 if expression evaluates to non-0, 1 if 0, else 2