From c976c63fb55d26430bd642f740d09577c697e8d2 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 22 Apr 2020 14:05:20 +0200 Subject: [PATCH] WIP udp --- slsDetectorSoftware/src/Detector.cpp | 2 ++ slsDetectorSoftware/src/Receiver.cpp | 10 +++++++++- slsDetectorSoftware/src/Receiver.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index b132cdf72..1fa17021a 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -633,6 +633,8 @@ Result Detector::getDestinationUDPIP(Positions pos) const { void Detector::setDestinationUDPIP(const IpAddr ip, Positions pos) { pimpl->Parallel(&Module::setDestinationUDPIP, pos, ip); + auto mac = pimpl->Parallel1(&Receiver::setDestinationUDPIP, pos, {}, ip).squash(); + setDestinationUDPMAC(mac, pos); } Result Detector::getDestinationUDPIP2(Positions pos) const { diff --git a/slsDetectorSoftware/src/Receiver.cpp b/slsDetectorSoftware/src/Receiver.cpp index d0ce4cfa4..54524bef3 100755 --- a/slsDetectorSoftware/src/Receiver.cpp +++ b/slsDetectorSoftware/src/Receiver.cpp @@ -361,7 +361,15 @@ void Receiver::restreamStop() { } /** Network Configuration (Detector<->Receiver) */ - +sls::MacAddr Receiver::setDestinationUDPIP(const IpAddr ip) { + LOG(logDEBUG1) << "Setting destination udp ip to " << ip; + if (ip == 0) { + throw RuntimeError("Invalid destination udp ip address"); + } + sls::MacAddr retval(0LU); + sendToReceiver(F_SET_RECEIVER_UDP_IP, ip, retval); + return retval; +} /** Detector Parameters */ void Receiver::setNumberOfFrames(int64_t value) { diff --git a/slsDetectorSoftware/src/Receiver.h b/slsDetectorSoftware/src/Receiver.h index 89900cccc..0686a6b39 100755 --- a/slsDetectorSoftware/src/Receiver.h +++ b/slsDetectorSoftware/src/Receiver.h @@ -76,6 +76,7 @@ class Receiver : public virtual slsDetectorDefs { * Network Configuration (Detector<->Receiver) * * * * ************************************************/ + sls::MacAddr setDestinationUDPIP(const sls::IpAddr ip); /************************************************** * *