diff data-provider.h @ 91:4102fe614df2

Fix timestamping. Cleanup data providers
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 22 Mar 2013 16:32:15 +0100
parents
children 99cbe2b57530
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data-provider.h	Fri Mar 22 16:32:15 2013 +0100
@@ -0,0 +1,31 @@
+#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