			***************************
			PREDICT With Socket Library
			***************************

The network sockets feature of PREDICT allows the program to operate
as a server, and provide tracking data to client applications using the
UDP protocol.  Client applications can request longitude, latitude, azimuth,
elevation, footprint data, Doppler shift information, and the time of the
next AOS for a particular satellite, as well as a list of the satellite
names in the current database.  It is even possible to have the PREDICT
server and client applications running on separate machines provided
the clients are connected to the server through a network.


System Configuration
====================
For the socket-based server features of PREDICT to function, the following
line needs to be added to the end your /etc/services file:

	predict   1210/udp

The port number can be changed if desired.  There will not be a need to
recompile the program if you do.


Program Operations
==================
Start PREDICT with the -s switch (predict -s) to start the program as a
socket-based server.  The program will start and automatically go into the
multi-satellite tracking mode.  Clients may poll PREDICT for tracking data
when the program is running in either the multi-satellite or single-satellite
tracking mode.  When in multi-tracking mode, tracking data for any of the
24 satellites in the program's database may be accessed by client programs.
When in single-tracking mode, only live tracking data for the single satellite
being tracked may be accessed.  Either tracking mode may be ended at any
time.  When this is done, the socket code will return the last calculated
satellite tracking data until the program is again put into a real-time
tracking mode.  This allows the user to return to the main menu, and use
other features of the program without sending potentially harmful data
to client programs.


Client Program Interface
========================
The best way to write a client program is to use the demonstration program
(demo.c) included in this distribution of PREDICT as a guide.  The sample
program has comments to explain how each component operates.  The code
that sends the data requests to PREDICT is in the main() function.

In operation, a character array is filled with the command and arguments
to be sent to PREDICT.  A socket connection is then opened, the request
is sent, a response is received, and the socket connection is closed.
The command and arguments are in ASCII text format.  For example:

     GET_SAT OSCAR-10

polls PREDICT for real-time tracking data for the OSCAR-10 satellite.  The
name passed must match the name that is listed by PREDICT in multitracking
mode.  The command string passed to PREDICT must end with an end of line
('\n') character.  The satellite's object number may be used in lieu of
the satellite name.

PREDICT then returns an easily parsed, new-line delimited ASCII string:

OSCAR-10
320.03 
-1.31 
74.95  
-28.11
951722253
17744.79

The values returned are as follows:

Name:		OSCAR-10
Longitude:	320.03 (degrees West)
Latitude:	-1.31 (degrees North)
Azimuth:	74.95 (degrees)
Elevation:	-28.11 (degrees)
Next AOS Time:	951722253 (seconds since January 1, 1970)
Footprint:	17744.79 (kilometers)

If the satellite is in either a geostationary orbit or an orbit that
does not permit AOS to occur at the groundstation, a zero (0) is returned
for the next AOS time.

Doppler shift information may also be obtained from PREDICT.  To read
Dopper shift information, the command sent to PREDICT is GET_DOPPLER.
For example:

	GET_DOPPLER OSCAR-27

returns the string:

OSCAR-27
961.742249

The Doppler shift returned by PREDICT is a normalized to a 100 MHz
downlink from the satellite, and must be scaled by the client to the
operating frequency of interest.  For example, to determine the amount
of Doppler shift experienced on a 435 MHz downlink, simply multiply the
value returned by 4.35.  To calculate the Doppler shift on a 146 MHz
uplink, multiply the amount by -1.46.

A third socket command that may be issued to PREDICT is the GET_LIST
command.  This command returns the names of the satellites in PREDICT's
orbital database.  It must be called 24 times to return the names of
all the satellites in the current database.

-- 
Ivan Galysh, KD4HBO
John A. Magliacane, KD2BD
