mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
trying
This commit is contained in:
@ -622,7 +622,7 @@ enum communicationProtocol{
|
|||||||
nsending = (length>packet_size) ? packet_size:length; //works for eiger to get packets to discard image header packets
|
nsending = (length>packet_size) ? packet_size:length; //works for eiger to get packets to discard image header packets
|
||||||
}
|
}
|
||||||
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
|
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
|
||||||
cout<<"nsent:"<<nsent<<endl;
|
cprintf(BLUE,"read %d\n",nsent);
|
||||||
if(nsent != nsending){ //if((nsent != nsending)){ && (nsent < packet_size)){
|
if(nsent != nsending){ //if((nsent != nsending)){ && (nsent < packet_size)){
|
||||||
if(nsent && (nsent != header_packet_size) && (nsent != -1))
|
if(nsent && (nsent != header_packet_size) && (nsent != -1))
|
||||||
cprintf(RED,"Incomplete Packet size %d\n",nsent);
|
cprintf(RED,"Incomplete Packet size %d\n",nsent);
|
||||||
@ -645,9 +645,9 @@ enum communicationProtocol{
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
//#ifdef VERY_VERBOSE
|
#ifdef VERY_VERBOSE
|
||||||
cout << "sent "<< total_sent << " Bytes" << endl;
|
cout << "sent "<< total_sent << " Bytes" << endl;
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return total_sent;
|
return total_sent;
|
||||||
|
@ -2102,6 +2102,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
int currentfnum=-1;
|
int currentfnum=-1;
|
||||||
|
|
||||||
//read first packet header
|
//read first packet header
|
||||||
|
cout<<"going to read header " << JFRAU_HEADER_LENGTH <<endl;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
||||||
@ -2120,6 +2121,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
cout<<"current fnum:"<<(*((uint32_t*)(buffer[ithread]+8)))<<endl;
|
cout<<"current fnum:"<<(*((uint32_t*)(buffer[ithread]+8)))<<endl;
|
||||||
}
|
}
|
||||||
//get data
|
//get data
|
||||||
|
cout<<"going to read data " << oneDataSize <<endl;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, oneDataSize);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, oneDataSize);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
cout<<"got data for " << pnum << endl;
|
cout<<"got data for " << pnum << endl;
|
||||||
@ -2130,6 +2132,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
break;
|
break;
|
||||||
pnum --;
|
pnum --;
|
||||||
|
|
||||||
|
cout<<"going to read header " << JFRAU_HEADER_LENGTH <<endl;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
||||||
@ -2145,8 +2148,10 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
offset = fifoBufferHeaderSize;
|
offset = fifoBufferHeaderSize;
|
||||||
//find the start of next image
|
//find the start of next image
|
||||||
while(currentpnum != (packetsPerFrame-1)){
|
while(currentpnum != (packetsPerFrame-1)){
|
||||||
|
cout<<"going to read data " << oneDataSize <<endl;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, oneDataSize);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, oneDataSize);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
|
cout<<"going to read header " << JFRAU_HEADER_LENGTH <<endl;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
||||||
|
Reference in New Issue
Block a user