/************************************************************************/
/* Copyright 2003-2012 MBARI						*/
/************************************************************************/
/* Summary  : Real-time Clock support for BEDS System			*/
/* Filename : clock.c							*/
/* Author   : Robert Herlien (rah)					*/
/* Project  : Benthic Event Detection System (BEDS)			*/
/* Revision : 1.0							*/
/* Created  : 10/18/2011 from Oasis4 clock.c				*/
/*									    */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*									    */
/************************************************************************/
/* Modification History:						*/
/* 18oct2011 rah - created						*/
/************************************************************************/

#ifndef INCclockh
#define INCclockh	1

#include <cfxpico.h>
#include <time.h>

typedef ulong		getTimeFunc(ulong *, ushort *);
typedef getTimeFunc	*gtfptr;


/****************************************/
/* Function Declarations		*/
/****************************************/

char		*BEDSTimeCmd(CmdInfoPtr cip);
char		*BEDSDateCmd(CmdInfoPtr cip);
char		*BEDSTimeOffsetCmd(CmdInfoPtr cip);
char		*BEDSSetPicoClkFromAccurateClk(CmdInfoPtr cip);
char		*BEDSSetAccurateClkFromPicoClk(CmdInfoPtr cip);
time_t		clkGetTime(time_t *secondp, Nat16 *msp);
time_t		clkGetAccurateTime(Void);
Void		clkSetAccurateTime(time_t now);
Void		clkCalcTimeOffset(Void);
Int32		clkGetTimeOffset(Void);
Void		enableClkInt(Void);
Void		disableClkInt(Void);
Void		clkInit();
Void		clk_printtime(time_t ptime);

#endif	/* INCclockh */
