@@ -157,7 +157,9 void SpwTcpPacketServer::sendSPWPacketUs | |||||
157 | onePacketReceived(); |
|
157 | onePacketReceived(); | |
158 | if(data[0]==(char)0) // Protocole = 0 => Host to SpaceWire packet transmission |
|
158 | if(data[0]==(char)0) // Protocole = 0 => Host to SpaceWire packet transmission | |
159 | { |
|
159 | { | |
160 | int size = (data[1]*256*256) + (data[2]*256) + data[3]; |
|
160 | int size = ( (unsigned char) data[1] ) * 256 * 256 | |
|
161 | + ( (unsigned char) data[2] ) * 256 | |||
|
162 | + (unsigned char) data[3]; | |||
161 | char* SPWpacket = (char*)malloc(size); |
|
163 | char* SPWpacket = (char*)malloc(size); | |
162 | memcpy(SPWpacket,data.data()+4,size); // 4 bytes will be added later to the packet |
|
164 | memcpy(SPWpacket,data.data()+4,size); // 4 bytes will be added later to the packet | |
163 | emit sendSPWPacket(SPWpacket,size); |
|
165 | emit sendSPWPacket(SPWpacket,size); |
General Comments 0
You need to be logged in to leave comments.
Login now