changeset 271:4a2fa10b8421 default tip

Publish DDS and measured frequencies through ZMQ
author Daniele Nicolodi <daniele.nicolodi@nist.gov>
date Sat, 15 Aug 2020 18:22:42 -0600
parents a451d4618dbf
children
files FXAnalyse.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Fri Jul 10 15:21:15 2015 +0200
+++ b/FXAnalyse.c	Sat Aug 15 18:22:42 2020 -0600
@@ -1557,6 +1557,25 @@
 				int r = zmq_xpub(zmqsocket, "RAW", &ev, sizeof(ev));
 				if (r)
 					logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
+
+				struct event tmp = { .time = ev.time };
+
+				// publish DDS frequencies through ZMQ
+				memcpy(&tmp.data, &ad9912.frequency, sizeof(ad9912.frequency));
+				int r = zmq_xpub(zmqsocket, "DDS", &tmp, sizeof(tmp));
+				if (r)
+					logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
+
+				// publish measured frequencies through ZMQ
+				tmp.data[0] = Math1;
+				tmp.data[1] = Math2;
+				tmp.data[2] = Math3;
+				tmp.data[3] = Math4;
+				tmp.data[4] = Math5;
+				int r = zmq_xpub(zmqsocket, "FREQ", &tmp, sizeof(tmp));
+				if (r)
+					logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
+
 			}
 			break;
 	}