mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
size change in receiver call back API now streamed, gui allows smaller packet size than expected to be caught and replaced the rest with 0xFF
This commit is contained in:
@ -24,6 +24,7 @@ using namespace rapidjson;
|
||||
#define MAX_STR_LENGTH 1000
|
||||
|
||||
//#define ZMQ_DETAIL
|
||||
#define ROIVERBOSITY
|
||||
|
||||
class ZmqSocket {
|
||||
|
||||
@ -426,7 +427,15 @@ public:
|
||||
memcpy(buf, (char*)zmq_msg_data(&message), size);
|
||||
}
|
||||
|
||||
//incorrect size
|
||||
//incorrect size (smaller)
|
||||
else if (length < size){
|
||||
#ifdef ROIVERBOSITY
|
||||
cprintf(RED,"Error: Received smaller packet size %d for socket %d\n", length, index);
|
||||
#endif
|
||||
memcpy(buf, (char*)zmq_msg_data(&message), length);
|
||||
memset(buf+length,0xFF,size-length);
|
||||
}
|
||||
//incorrect size (larger)
|
||||
else {
|
||||
cprintf(RED,"Error: Received weird packet size %d for socket %d\n", length, index);
|
||||
memset(buf,0xFF,size);
|
||||
|
Reference in New Issue
Block a user