view sr-data-logger.h @ 232:52f882f39c16

Implement correction proportional to frequency in dedrift code Reorganize code and options handling
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 27 Oct 2014 18:08:17 +0100
parents 97112b45b838
children
line wrap: on
line source

#ifndef __SR_DATA_LOGGER_H__
#define __SR_DATA_LOGGER_H__

struct datalogger {
	int enabled;
	unsigned int sock;
	/* configuration parameters */
	char *id;
	char *host;
	int port;
};


int sr_datalogger_init(struct datalogger *dl);
void sr_datalogger_dispose(struct datalogger *dl);
int __sr_datalogger_send(struct datalogger *dl, double utc, double data);


static inline int sr_datalogger_send(struct datalogger *dl, double utc, double data)
{
	if (dl->enabled)
		return __sr_datalogger_send(dl, utc, data);
	return 0;
}

#endif