Loading include/InputPacketStream.h +2 −1 Original line number Diff line number Diff line Loading @@ -62,8 +62,9 @@ public: /// This method read a telemetry packet /// \pre The setInput method must be invocated /// \param bDecode if true decode the method will decode the data fields. /// \return A pointer telemetry packet. Make attention: the object returned is one of the TM packet object of the array of this object. Don't delete it! Packet* readPacket() throw(PacketExceptionIO*); Packet* readPacket(bool bDecode = true) throw(PacketExceptionIO*); Packet* decodePacket(ByteStreamPtr stream); Loading include/Packet.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ public: /// correct value virtual bool setAndVerifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packet); /// Set the internal prefix and packet. Decode only the header. virtual void setByteStreamPointers(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField); /// Sets all the fields of the packet with correct value contained into the input ByteStream. /// \pre The structure of the stream must be loaded. /// \param prefix This is the prefix of the packet Loading src/InputPacketStream.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ void InputPacketStream::setInput(Input* in) Packet* InputPacketStream::readPacket() throw(PacketExceptionIO*) Packet* InputPacketStream::readPacket(bool bDecode) throw(PacketExceptionIO*) { unsigned dimHeader = getHeaderDimension(); unsigned dimPrefix = getPrefixDimension(); Loading Loading @@ -145,9 +145,19 @@ Packet* InputPacketStream::readPacket() throw(PacketExceptionIO*) else pindex = detPacketType(b0, b1, b2); } Packet* p = packetType[pindex]; if(bDecode) { if(!p->setPacketValue(b0, b1, b2)) //gli stream diventano del packet throw new PacketExceptionIO("it is impossible to resolve the packet."); } else { p->setByteStreamPointers(b0, b1, b2); } return p; } catch(PacketExceptionIO* e) Loading src/Packet.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -292,13 +292,18 @@ void Packet::printIdentifiers() } } bool Packet::setPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) void Packet::setByteStreamPointers(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) { //cout << "@ " << packetDataField->getDimension() << endl; memByteStream(prefix, packetHeader, packetDataField); ByteStreamPtr packet = ByteStreamPtr(new ByteStream(packetHeader, packetDataField, 0)); memByteStream(prefix, packet); } bool Packet::setPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) { setByteStreamPointers(prefix, packetHeader, packetDataField); //cout << "@ " << packetDataField->getDimension() << endl; /// 1) if(!setPacketValueVerify(prefix, packetHeader, packetDataField)) { Loading Loading
include/InputPacketStream.h +2 −1 Original line number Diff line number Diff line Loading @@ -62,8 +62,9 @@ public: /// This method read a telemetry packet /// \pre The setInput method must be invocated /// \param bDecode if true decode the method will decode the data fields. /// \return A pointer telemetry packet. Make attention: the object returned is one of the TM packet object of the array of this object. Don't delete it! Packet* readPacket() throw(PacketExceptionIO*); Packet* readPacket(bool bDecode = true) throw(PacketExceptionIO*); Packet* decodePacket(ByteStreamPtr stream); Loading
include/Packet.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ public: /// correct value virtual bool setAndVerifyPacketValue(ByteStreamPtr prefix, ByteStreamPtr packet); /// Set the internal prefix and packet. Decode only the header. virtual void setByteStreamPointers(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField); /// Sets all the fields of the packet with correct value contained into the input ByteStream. /// \pre The structure of the stream must be loaded. /// \param prefix This is the prefix of the packet Loading
src/InputPacketStream.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ void InputPacketStream::setInput(Input* in) Packet* InputPacketStream::readPacket() throw(PacketExceptionIO*) Packet* InputPacketStream::readPacket(bool bDecode) throw(PacketExceptionIO*) { unsigned dimHeader = getHeaderDimension(); unsigned dimPrefix = getPrefixDimension(); Loading Loading @@ -145,9 +145,19 @@ Packet* InputPacketStream::readPacket() throw(PacketExceptionIO*) else pindex = detPacketType(b0, b1, b2); } Packet* p = packetType[pindex]; if(bDecode) { if(!p->setPacketValue(b0, b1, b2)) //gli stream diventano del packet throw new PacketExceptionIO("it is impossible to resolve the packet."); } else { p->setByteStreamPointers(b0, b1, b2); } return p; } catch(PacketExceptionIO* e) Loading
src/Packet.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -292,13 +292,18 @@ void Packet::printIdentifiers() } } bool Packet::setPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) void Packet::setByteStreamPointers(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) { //cout << "@ " << packetDataField->getDimension() << endl; memByteStream(prefix, packetHeader, packetDataField); ByteStreamPtr packet = ByteStreamPtr(new ByteStream(packetHeader, packetDataField, 0)); memByteStream(prefix, packet); } bool Packet::setPacketValue(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField) { setByteStreamPointers(prefix, packetHeader, packetDataField); //cout << "@ " << packetDataField->getDimension() << endl; /// 1) if(!setPacketValueVerify(prefix, packetHeader, packetDataField)) { Loading