From a17aeedf5d70e8e0328ea19bacdfa298092f318a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 25 Feb 2019 11:19:55 +0100 Subject: zmq2edi: Fix MNSC endianness swap --- src/zmq2edi/EDISender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zmq2edi') diff --git a/src/zmq2edi/EDISender.cpp b/src/zmq2edi/EDISender.cpp index 112aadb..0df633f 100644 --- a/src/zmq2edi/EDISender.cpp +++ b/src/zmq2edi/EDISender.cpp @@ -192,8 +192,8 @@ void EDISender::send_eti_frame(uint8_t* p, metadata_t metadata) edi_subchannelToTag[i] = tag_ESTn; } - const uint16_t mnsc = p[8 + 4*nst] * 256 + \ - p[8 + 4*nst + 1]; + uint16_t mnsc = 0; + std::memcpy(&mnsc, p + 8 + 4*nst, sizeof(uint16_t)); edi_tagDETI.mnsc = mnsc; /*const uint16_t crc1 = p[8 + 4*nst + 2]*256 + \ -- cgit v1.2.3