From 7d23cc19b14b5faf2936b0ef8ada3cdc1cb47d8a Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Fri, 16 Aug 2024 19:48:09 -0700 Subject: [PATCH 1/2] Fixed segment size calculation --- python/pyrogue/protocols/_Network.py | 4 ++-- src/rogue/protocols/udp/Client.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pyrogue/protocols/_Network.py b/python/pyrogue/protocols/_Network.py index 977b40f5b..83d475c81 100644 --- a/python/pyrogue/protocols/_Network.py +++ b/python/pyrogue/protocols/_Network.py @@ -28,10 +28,10 @@ def __init__(self,*, port, host='127.0.0.1', jumbo=False, wait=True, packVer=1, if server: self._udp = rogue.protocols.udp.Server(port,jumbo) - self._rssi = rogue.protocols.rssi.Server(self._udp.maxPayload()) + self._rssi = rogue.protocols.rssi.Server(self._udp.maxPayload()-8) else: self._udp = rogue.protocols.udp.Client(host,port,jumbo) - self._rssi = rogue.protocols.rssi.Client(self._udp.maxPayload()) + self._rssi = rogue.protocols.rssi.Client(self._udp.maxPayload()-8) if packVer == 2: self._pack = rogue.protocols.packetizer.CoreV2(False,True,enSsi) # ibCRC = False, obCRC = True diff --git a/src/rogue/protocols/udp/Client.cpp b/src/rogue/protocols/udp/Client.cpp index 0030ac77b..3dc2b6c6c 100644 --- a/src/rogue/protocols/udp/Client.cpp +++ b/src/rogue/protocols/udp/Client.cpp @@ -202,7 +202,7 @@ void rpu::Client::runThread(std::weak_ptr lockPtr) { if (res > 0) { // Message was too big if (res > avail) { - udpLog_->warning("Receive data was too large. Dropping."); + udpLog_->warning("Receive data was too large. Rx=%i, avail=%i Dropping.",res,avail); } else { buff->setPayload(res); sendFrame(frame); From 38f9833bb9795ad85886a5d2074c02bc8ba0da9e Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Fri, 16 Aug 2024 19:56:11 -0700 Subject: [PATCH 2/2] Fix linter error --- src/rogue/protocols/udp/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rogue/protocols/udp/Client.cpp b/src/rogue/protocols/udp/Client.cpp index 3dc2b6c6c..f5a88c2a4 100644 --- a/src/rogue/protocols/udp/Client.cpp +++ b/src/rogue/protocols/udp/Client.cpp @@ -202,7 +202,7 @@ void rpu::Client::runThread(std::weak_ptr lockPtr) { if (res > 0) { // Message was too big if (res > avail) { - udpLog_->warning("Receive data was too large. Rx=%i, avail=%i Dropping.",res,avail); + udpLog_->warning("Receive data was too large. Rx=%i, avail=%i Dropping.", res, avail); } else { buff->setPayload(res); sendFrame(frame);