GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> THS / dev > timetone / rhel5-64
#include <time.h>
Typedefs | |
typedef unsigned int(* | THS_sntp_timetone_cb )(unsigned int absTimeSec, unsigned int flags) |
Typedef for THS_sntp timetone callback routine. | |
Functions | |
unsigned int | THS_sntpGetTime (struct timespec *curTime, char *remoteHost, time_t *tripTime) |
Read a Sntp server over net (RFC2030). | |
unsigned int | THS_sntpGetRfc868Time (time_t *curTime, char *remoteHost) |
Read a time server over net (RFC868) (actually simpiler than SNTP). | |
unsigned int | THS_sntpTimeStr (time_t *timeIn, char *buff) |
convert 32b time in sec to ascii string | |
unsigned int | THS_sntpTimeLoop (char *server) |
Simple loop to just read the timeserver. | |
unsigned int | THS_sntpTimetoneTask (char *server, THS_sntp_timetone_cb cb, int printIt) |
Timetone task to run as SC simulator (probably mv2304 with 1553). |
This file implements routines to simluate the once a second timetone messgae.
These routines poll a NTP or SNTP time server over the net and call the given callback when there is a change in the secconds field of the time.
Although these routines can use any timeserver, for accurate testing we expect to poll the XLi time server that also provides a correlated PPS signal to the LAT.
unsigned int(* THS_sntp_timetone_cb)(void *prm, WCT_time absTime) |
Typedef for THS_sntp timetone callback routine.
absTimeSec | Seconds since 1/1/2001 provided by timetone | |
flags | User provided flags |
unsigned int THS_sntpGetRfc868Time | ( | time_t * | curTime, | |
char * | remoteHost | |||
) |
Read a time server over net (RFC868) (actually simpiler than SNTP).
curTime | - fill in current time in this buffer | |
remoteHost | - SNTP server to talk to |
Referenced by THS_sntpTimeLoop().
unsigned int THS_sntpGetTime | ( | struct timespec * | curTime, | |
char * | remoteHost, | |||
time_t * | tripTime | |||
) |
Read a Sntp server over net (RFC2030).
curTime | - fill in current time in this buffer | |
remoteHost | - SNTP server to talk to | |
tripTime | - fill in trip time in this buffer |
Referenced by THS_sntpTimeLoop(), and THS_sntpTimetoneTask().
unsigned int THS_sntpTimeLoop | ( | char * | server | ) |
Simple loop to just read the timeserver.
server | - SNTP server to talk to |
References THS_sntpGetRfc868Time(), THS_sntpGetTime(), and THS_sntpTimeStr().
unsigned int THS_sntpTimeStr | ( | time_t * | timeIn, | |
char * | buff | |||
) |
convert 32b time in sec to ascii string
timeIn | time to convert | |
buff | buffer to fill with ascii |
Referenced by THS_sntpTimeLoop(), and THS_sntpTimetoneTask().
unsigned int THS_sntpTimetoneTask | ( | char * | server, | |
THS_sntp_timetone_cb | cb, | |||
int | printIt | |||
) |
Timetone task to run as SC simulator (probably mv2304 with 1553).
server | SNTP server to talk to | |
cb | if not NULL, run the callback once a sec where cb(absTime, flags) | |
printIt | Sprint info as process |
References THS_sntpGetTime(), and THS_sntpTimeStr().