# HG changeset patch # User Daniele Nicolodi # Date 1597537362 21600 # Node ID 4a2fa10b8421e8e1b8148abfc19ec0059fc7e5b9 # Parent a451d4618dbff55710c0ffc5446bddd0ddd9c2a9 Publish DDS and measured frequencies through ZMQ diff -r a451d4618dbf -r 4a2fa10b8421 FXAnalyse.c --- 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; }