diff kk-data-provider.c @ 120:84fb0796936b

Add KK counter measurement interval synchronization to PPS trigger
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Tue, 17 Sep 2013 14:18:20 +0200
parents 4f1f353e84f5
children 4ff3e468ab5f
line wrap: on
line diff
--- a/kk-data-provider.c	Thu Sep 12 18:01:49 2013 +0200
+++ b/kk-data-provider.c	Tue Sep 17 14:18:20 2013 +0200
@@ -114,6 +114,18 @@
 		goto error;
 	}
 	
+	/* enable synchronization */
+	rv = FX_Send("\x0F");
+	if (! rv) {
+		SendMessage(mainThreadId, FX_Error());
+		goto error;
+	}
+	rv = FX_Recv(&resp, TIMEOUT);
+	if (! rv) {
+		SendMessage(mainThreadId, FX_Error());
+		goto error;
+	}
+	
 	while (acquiring) {
 		/* receive data from counter */
 		FX_Recv(&resp, TIMEOUT);
@@ -152,6 +164,9 @@
 			if (strcmp(resp + 6, "$2900")) {
 				SendMessage(mainThreadId, "KK Counter: %s", resp);
 			}
+		} else if (strneq(resp, "7F51", 4)) {
+			/* measurement interval synchronized */
+			SendMessage(mainThreadId, "KK Counter measurement interval synchronized");
 		} else {
 			/* send message to the main thread */
 			SendMessage(mainThreadId, "KK Counter: %s", resp);