Main Page | Data Structures | File List | Data Fields | Globals

server.c File Reference

AzCam Server Command Functions. More...

#include "azcam.h"

Functions

int CloseConnection (azcam_t *cam, char *reply)
 Close the AzCam Server Connection.
int RunScript (azcam_t *cam, char *script, char *reply)
 Execute an AzCam command script on the server.
int SetParameter (azcam_t *cam, char *keyword, char *value, char *comment, char *reply)
 Set a FITS card in the AzCam server's header database.
int GetParameter (azcam_t *cam, char *keyword, char *value, char *reply)
 Get the value of a FITS card in the AzCam server's header database.
int ClearParameter (azcam_t *cam, char *reply)
 Clear the AzCam server's FITS header database.


Detailed Description

AzCam Server Command Functions.

The following are a suite of interface functions that provide access to all of the AzCam Server control and database functions.

Most function names recapitulate the analogous AzCam server commands, while others serve as "meta" functions that encapsulate a number of AzCam commands under a single logical function.

All routines call the communication layer routines in iosubs.c to take care of common handling of timeout, errors, and reply processing.

All of the server control and database commands documented in Sections 6 and 7 of the AzCam Programmers Reference Manual have been implemented.

A new function

  ClearParameter()
  
has been defined to implement the "SetParameter CLEARALL ..." command.

Author:
R. Pogge, OSU Astronomy Dept. (pogge@astronomy.ohio-state.edu)
Date:
2005 May 17

Function Documentation

int CloseConnection azcam_t cam,
char *  reply
 

Close the AzCam Server Connection.

Parameters:
cam pointer to an azcam struct with the server parameters
reply string to contain any reply text
Returns:
0 on success, -1 on failure. reply contains an error messages.
Transmits a CloseConnection command to an open AzCam server and closes the client-side socket, resetting the file descriptor to the "no connection" state (azcam::FD=-1).

int RunScript azcam_t cam,
char *  script,
char *  reply
 

Execute an AzCam command script on the server.

Parameters:
cam pointer to an azcam struct with the server parameters
script string with the full filename of the command script
reply string to contain any reply text
Returns:
0 if successful, -1 on errors, with error text in reply
Instructs the AzCam server to run a script on the server proper. Note that the script file must be on a valid path as seen by the server, not the client. This is most often used to execute large blocks of AzCam server commands from files resident on the server proper (e.g., the standard startup commands to configure a particular camera).

int SetParameter azcam_t cam,
char *  keyword,
char *  value,
char *  comment,
char *  reply
 

Set a FITS card in the AzCam server's header database.

Parameters:
cam pointer to an azcam struct with the server parameters
keyword string with the FITS keyword to set
value string with the data value associated with the keyword
comment string describing the keyword
reply string to contain any reply text
Returns:
0 if successful, -1 on errors, with error text in reply
Uploads a new FITS header parameter into the AzCam server's FITS header database using the SetParameter command.

This feature of AzCam is somewhat inflexible in that all parameters are treated as string type FITS header keywords. A sensible AzCam client application will employ a postprocessing routine to launder the non-standard FITS headers coming from the AzCam server into more conventional form.

See also:
ClearParameter(), GetParameter()

int GetParameter azcam_t cam,
char *  keyword,
char *  value,
char *  reply
 

Get the value of a FITS card in the AzCam server's header database.

Parameters:
cam pointer to an azcam struct with the server parameters.
keyword string with the keyword to retrieve
value string with the keyword value
reply string to contain any reply text
Returns:
0 if successful, -1 on errors, with error text in reply
Gets the value of a FITS header keyword from the AzCam server's FITS header database, putting the result into the value string. This function only returns the current keyword value, not the text of the comment associated with the keyword. Unknown keywords generate an error.

Note that the AzCam server stores all user-defined header parameters as strings. The calling application will need to translate that string into the appropriate data type (int, float, boolean, or string) as required.

See also:
SetParameter(), ClearParameter()

int ClearParameter azcam_t cam,
char *  reply
 

Clear the AzCam server's FITS header database.

Parameters:
cam pointer to an azcam struct with the server parameters
reply string to contain any reply text.
Returns:
0 if successful, -1 on errors, with error text in reply
Clears all parameters from the AzCam server's FITS header keyword database. Sends the "SetParameter CLEARALL" command to the server.

See also:
SetHeader(), GetParameter()


Generated on Tue May 24 13:55:31 2005 for AzCam CCD Camera Client API by  doxygen 1.4.2