comparison FXAnalyse.c @ 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
comparison
equal deleted inserted replaced
270:a451d4618dbf 271:4a2fa10b8421
1555 1555
1556 // publish data through ZMQ 1556 // publish data through ZMQ
1557 int r = zmq_xpub(zmqsocket, "RAW", &ev, sizeof(ev)); 1557 int r = zmq_xpub(zmqsocket, "RAW", &ev, sizeof(ev));
1558 if (r) 1558 if (r)
1559 logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r)); 1559 logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
1560
1561 struct event tmp = { .time = ev.time };
1562
1563 // publish DDS frequencies through ZMQ
1564 memcpy(&tmp.data, &ad9912.frequency, sizeof(ad9912.frequency));
1565 int r = zmq_xpub(zmqsocket, "DDS", &tmp, sizeof(tmp));
1566 if (r)
1567 logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
1568
1569 // publish measured frequencies through ZMQ
1570 tmp.data[0] = Math1;
1571 tmp.data[1] = Math2;
1572 tmp.data[2] = Math3;
1573 tmp.data[3] = Math4;
1574 tmp.data[4] = Math5;
1575 int r = zmq_xpub(zmqsocket, "FREQ", &tmp, sizeof(tmp));
1576 if (r)
1577 logmessage(ERROR, "cannot send data through ZMQ socket: %s", zmq_strerror(r));
1578
1560 } 1579 }
1561 break; 1580 break;
1562 } 1581 }
1563 } 1582 }
1564 1583