Loading include/SourceDataField.h +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ public: virtual ~SourceDataField(); /// Sets the stream of byte. This method assigns the value of stream for each field of part of packet virtual bool setByteStream(ByteStreamPtr s, bool onlySections = false) { PartOfPacket::setByteStream(s); return true; }; /// Gets the total max dimension in bytes of source data field virtual dword getMaxDimension() = 0; Loading src/Packet.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -402,7 +402,7 @@ bool Packet::verifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, for(unsigned i = 0; i< number_of_identifier; i++) { PacketIdentifier* pi = identifiers[i]; Field* f; Field* f = NULL; switch(pi->type) { case 0: Loading @@ -416,7 +416,7 @@ bool Packet::verifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, f = dataField->sourceDataField->getFields(pi->fieldNumber); break; } if(f->value != pi->value) if(f == NULL || f->value != pi->value) { verified = false; break; Loading src/PartOfPacket.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ PartOfPacket::~PartOfPacket() string* PartOfPacket::printStructure() { bool first = true; char *s; char *s = NULL; for(unsigned i=0; i< numberOfFields; i++) { Loading Loading @@ -268,7 +268,7 @@ bool PartOfPacket::setByteStream(ByteStreamPtr s) /* cout << i << ": " << ftemp->value << endl; cout << i << ": " << (ftemp->value << currentDimBit) << endl; cout << i << ": " << wordtemp << endl;*/ ftemp->value = (ftemp->value) | wordtemp & pattern[dimbit]; ftemp->value = ftemp->value | (wordtemp & pattern[dimbit]); /* cout << i << ": " << ftemp->value << endl; cout << i << ": " << (wordtemp & pattern[dimbit]) << endl;*/ } Loading src/SDFBlockFixed.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -264,12 +264,12 @@ dword SDFBlockFixed::getDimension(word nblock) dword SDFBlockFixed::getMaxDimension() { /// Event dimension dword dimOfEventBlock; dword dimOfEventBlock = 0; if(block != NULL) dimOfEventBlock = block[0].getDimension(); else { ; //TODO lanciare una eccezione throw PacketException("Error on SDFBlockFixed::getMaxDimension: block is NULL"); } return dimOfEventBlock * maxNumberOfBlock[0]; } Loading src/SDFBlockVariable.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -29,12 +29,12 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) { try { char* line, *linesection; char* line, *linesection = NULL; word indexOfNElement; unsigned addToNElements; word maxNumberOfElement; bool first1 = true, first2 = true; MemoryBuffer* buffer1, *buffer2; MemoryBuffer* buffer1, *buffer2 = NULL; line = fp.getLine(); if(strcmp(line, "fixed") == 0) Loading Loading
include/SourceDataField.h +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ public: virtual ~SourceDataField(); /// Sets the stream of byte. This method assigns the value of stream for each field of part of packet virtual bool setByteStream(ByteStreamPtr s, bool onlySections = false) { PartOfPacket::setByteStream(s); return true; }; /// Gets the total max dimension in bytes of source data field virtual dword getMaxDimension() = 0; Loading
src/Packet.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -402,7 +402,7 @@ bool Packet::verifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, for(unsigned i = 0; i< number_of_identifier; i++) { PacketIdentifier* pi = identifiers[i]; Field* f; Field* f = NULL; switch(pi->type) { case 0: Loading @@ -416,7 +416,7 @@ bool Packet::verifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, f = dataField->sourceDataField->getFields(pi->fieldNumber); break; } if(f->value != pi->value) if(f == NULL || f->value != pi->value) { verified = false; break; Loading
src/PartOfPacket.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ PartOfPacket::~PartOfPacket() string* PartOfPacket::printStructure() { bool first = true; char *s; char *s = NULL; for(unsigned i=0; i< numberOfFields; i++) { Loading Loading @@ -268,7 +268,7 @@ bool PartOfPacket::setByteStream(ByteStreamPtr s) /* cout << i << ": " << ftemp->value << endl; cout << i << ": " << (ftemp->value << currentDimBit) << endl; cout << i << ": " << wordtemp << endl;*/ ftemp->value = (ftemp->value) | wordtemp & pattern[dimbit]; ftemp->value = ftemp->value | (wordtemp & pattern[dimbit]); /* cout << i << ": " << ftemp->value << endl; cout << i << ": " << (wordtemp & pattern[dimbit]) << endl;*/ } Loading
src/SDFBlockFixed.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -264,12 +264,12 @@ dword SDFBlockFixed::getDimension(word nblock) dword SDFBlockFixed::getMaxDimension() { /// Event dimension dword dimOfEventBlock; dword dimOfEventBlock = 0; if(block != NULL) dimOfEventBlock = block[0].getDimension(); else { ; //TODO lanciare una eccezione throw PacketException("Error on SDFBlockFixed::getMaxDimension: block is NULL"); } return dimOfEventBlock * maxNumberOfBlock[0]; } Loading
src/SDFBlockVariable.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -29,12 +29,12 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) { try { char* line, *linesection; char* line, *linesection = NULL; word indexOfNElement; unsigned addToNElements; word maxNumberOfElement; bool first1 = true, first2 = true; MemoryBuffer* buffer1, *buffer2; MemoryBuffer* buffer1, *buffer2 = NULL; line = fp.getLine(); if(strcmp(line, "fixed") == 0) Loading