view data-provider.h @ 94:b7ae2d947617

Change default KK port to COM4. Make port configurable via .ini file
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 22 Mar 2013 18:46:13 +0100
parents 4102fe614df2
children 99cbe2b57530
line wrap: on
line source

#ifndef __DATA_PROVIDER_H__
#define __DATA_PROVIDER_H__

#include <future.h>

/* data acquisition flag */
extern int acquiring;

/* data queue */
extern CmtTSQHandle dataQueue;

/* callback receiving messages in the main thread */
void CVICALLBACK MessageCB (void *callbackData);

/* data acquisition event */
struct event {
	struct timeval time;
	double data[4];
};

/* message */
static char message[1024]; 

#define SendMessage(threadId, ...)                                \
	do { 												          \
		snprintf(message, sizeof(message) - 1, ##__VA_ARGS__);    \
		PostDeferredCallToThread(MessageCB, message, threadId);   \
	} while (0)


#endif