receiver bug fix: function pointer not initialized as null in dataprocessor

This commit is contained in:
2019-04-18 09:27:02 +02:00
parent 6b4d6084f5
commit 708975acb5
5 changed files with 17 additions and 5 deletions

2
cmk.sh
View File

@ -168,7 +168,7 @@ fi
#Debug #Debug
if [ $DEBUG -eq 1 ]; then if [ $DEBUG -eq 1 ]; then
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug " CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
echo "Debug Option enabled" echo "Debug Option enabled"
fi fi

View File

@ -34,7 +34,6 @@
//parameters to calculate fifo depth //parameters to calculate fifo depth
#define SAMPLE_TIME_IN_NS 100000000//100ms #define SAMPLE_TIME_IN_NS 100000000//100ms
#define MAX_JOBS_PER_THREAD 1000
//to differentiate between gotthard and short gotthard //to differentiate between gotthard and short gotthard

View File

@ -54,7 +54,10 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
firstMeasurementIndex(0), firstMeasurementIndex(0),
numTotalFramesCaught(0), numTotalFramesCaught(0),
numFramesCaught(0), numFramesCaught(0),
currentFrameIndex(0) currentFrameIndex(0),
rawDataReadyCallBack(nullptr),
rawDataModifyReadyCallBack(nullptr),
pRawDataReady(nullptr)
{ {
if(ThreadObject::CreateThread() == FAIL) if(ThreadObject::CreateThread() == FAIL)
throw sls::RuntimeError("Could not create processing thread"); throw sls::RuntimeError("Could not create processing thread");

View File

@ -455,7 +455,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
carryOverFlag = false; carryOverFlag = false;
++numpackets; //number of packets in this image (each time its copied to buf) ++numpackets; //number of packets in this image (each time its copied to buf)
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS)] = 1; new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS - 1)] = 1;
//writer header //writer header
if(isHeaderEmpty) { if(isHeaderEmpty) {
@ -599,7 +599,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
break; break;
} }
++numpackets; //number of packets in this image (each time its copied to buf) ++numpackets; //number of packets in this image (each time its copied to buf)
new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS)] = 1; new_header->packetsMask[((pnum < MAX_NUM_PACKETS) ? pnum : MAX_NUM_PACKETS - 1)] = 1;
if(isHeaderEmpty) { if(isHeaderEmpty) {
// -------------------------- new header ---------------------------------------------------------------------- // -------------------------- new header ----------------------------------------------------------------------

View File

@ -708,6 +708,16 @@ int slsReceiverImplementation::setNumberofUDPInterfaces(const int n) {
// update row and column in dataprocessor // update row and column in dataprocessor
setDetectorPositionId(detID); setDetectorPositionId(detID);
// update call backs
if(rawDataReadyCallBack) {
for (const auto& it : dataProcessor)
it->registerCallBackRawDataReady(rawDataReadyCallBack,pRawDataReady);
}
if(rawDataModifyReadyCallBack) {
for (const auto& it : dataProcessor)
it->registerCallBackRawDataModifyReady(rawDataModifyReadyCallBack,pRawDataReady);
}
// test socket buffer size with current set up // test socket buffer size with current set up
if (setUDPSocketBufferSize(0) == FAIL) { if (setUDPSocketBufferSize(0) == FAIL) {
return FAIL; return FAIL;