Commit 27f60cb3 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

PacketStream::dimHeader loaded a config time

parent 5dc58535
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ public:

    /// Sets all the fields of the packet with correct value contained into the input ByteStream.
    /// \param stream A pointer to the stream of byte, with prefix and packet
	/// \param decode only the sections
    bool setPacketValue(byte* stream, bool onlySections = false);

    /// Verifies if within the ByteStream passed with arguments it's present a correct packet.
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@ protected:
    /// Indicates the dimension of prefix.
    word dimPrefix;
	
	/// The dimension of the header
	word dimHeader;

};

}
+1 −1
Original line number Diff line number Diff line
@@ -787,7 +787,7 @@ char* Packet::printPacketOutputStream()
    dword dim = getDimension();
    if(thereisprefix)
        dim += dimPrefix;
    ByteStream b(packet_output->stream, dim, bigendian);
    ByteStream b(packet_output->stream, dim, bigendian); //FIXME
    char* c = b.printStreamInHexadecimal();
    return c;
}
+4 −4
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ PacketStream::PacketStream(const char* fileNameConfig)
    //TODO
    memset(packetType, 0, sizeof(Packet*)*100);
    pathFileNameConfig = 0;
	dimHeader = 0;
}


@@ -52,6 +53,7 @@ PacketStream::PacketStream()
    //TODO
    memset(packetType, 0, sizeof(Packet*)*100);
    pathFileNameConfig = 0;
	dimHeader = 0;
}


@@ -139,6 +141,7 @@ bool PacketStream::createStreamStructure() throw(PacketException*)
                    throw new PacketExceptionFileFormat("No parameters in file header format");
                    return false;
                }
				dimHeader = headerReference->getDimension();
                /// It creates the PACKET NOT RECOGNIZED
                PacketNotRecognized* p = new PacketNotRecognized(bigendian);
                if(!p->createPacketType(line, prefix, dimPrefix))
@@ -214,10 +217,7 @@ word PacketStream::getPrefixDimension() const

word PacketStream::getHeaderDimension() const
{
    if(headerReference != 0)
        return headerReference->getDimension();
    else
        return 0;
	return dimHeader;
}