Skip to content
Snippets Groups Projects
Commit d208d45a authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

changes on comments

parent e7b49bd1
Branches
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key> <key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/> <false/>
<key>IDESourceControlProjectIdentifier</key> <key>IDESourceControlProjectIdentifier</key>
<string>C0D7884D-D58B-4D06-B8C5-B1FECC0AA1D1</string> <string>E78724CD-2D6E-4FB5-8CA7-AC2C1C56AE1B</string>
<key>IDESourceControlProjectName</key> <key>IDESourceControlProjectName</key>
<string>PacketLib</string> <string>PacketLib</string>
<key>IDESourceControlProjectOriginsDictionary</key> <key>IDESourceControlProjectOriginsDictionary</key>
......
...@@ -42,8 +42,7 @@ public: ...@@ -42,8 +42,7 @@ public:
/// This method read a telemetry packet /// This method read a telemetry packet
/// \pre The setInput method must be invocated /// \pre The setInput method must be invocated
/// \param bDecode if true decode the method will decode the data fields. /// \return A pointer of the packet. Make attention: the object returned is one of the TM packet object of the array of this object. Don't delete it!
/// \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() throw(PacketExceptionIO*);
......
...@@ -56,26 +56,27 @@ public: ...@@ -56,26 +56,27 @@ public:
virtual bool createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*); virtual bool createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*);
/// Sets the ByteStream. /// Decode the packet
/// \param stream A pointer to the stream of byte, with prefix and packet /// \param stream A pointer to the stream of byte, with prefix and packet
/// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght /// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght
virtual bool decode(ByteStreamPtr stream, bool checkPacketLenght = false); virtual bool decode(ByteStreamPtr stream, bool checkPacketLenght = false);
/// Sets the ByteStream. /// Decode the packet
/// \param prefix A pointer to the stream of byte, with the prefix /// \param prefix A pointer to the stream of byte, with the prefix
/// \param packet A pointer to the stream of byte, with the packet /// \param packet A pointer to the stream of byte, with the packet
/// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght /// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght
virtual bool decode(ByteStreamPtr prefix, ByteStreamPtr packet, bool checkPacketLenght = false); virtual bool decode(ByteStreamPtr prefix, ByteStreamPtr packet, bool checkPacketLenght = false);
/// Sets the ByteStream. /// Decode the packet
/// \param prefix A pointer to the stream of byte, with the prefix /// \param prefix A pointer to the stream of byte, with the prefix
/// \param packetHeader A pointer to the stream of byte, with the packet header /// \param packetHeader A pointer to the stream of byte, with the packet header
/// \param packetHeader A pointer to the stream of byte, with the packet data field /// \param packetHeader A pointer to the stream of byte, with the packet data field
/// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght /// \param checkPacketLenght if true check the packet lenght and set the packet stream, if false do not check the packet lenght
virtual bool decode(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField, bool checkPacketLenght = false); virtual bool decode(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField, bool checkPacketLenght = false);
/// Verify the content of the packet (after the decode)
///\return true is the packet contained into the stream is recognized using identifiers. ///\return true is the packet contained into the stream is recognized using identifiers.
///\pre the ByteStream is set with one of set(ByteStream) methods ///\pre the ByteStream is set with one of decode(ByteStream) methods
virtual bool verify(); virtual bool verify();
///\return compress the data section and change the packet (the variable part of the "source data field") ///\return compress the data section and change the packet (the variable part of the "source data field")
...@@ -85,10 +86,13 @@ public: ...@@ -85,10 +86,13 @@ public:
///\return decompress the data section without changing the packet (the variable part of the "source data field") ///\return decompress the data section without changing the packet (the variable part of the "source data field")
virtual ByteStreamPtr decompressData(); virtual ByteStreamPtr decompressData();
///Get the compression algorithm used for this packet
virtual enum CompressionAlgorithms getCompressionAlgorithm(); virtual enum CompressionAlgorithms getCompressionAlgorithm();
///Get the compression level used for this packet
virtual word getCompressionLevel(); virtual word getCompressionLevel();
///\return true if the packet is compressed
bool isCompressed() { bool isCompressed() {
if(compressible && getCompressionAlgorithm() != NONE) if(compressible && getCompressionAlgorithm() != NONE)
return true; return true;
...@@ -96,6 +100,7 @@ public: ...@@ -96,6 +100,7 @@ public:
return false; return false;
} }
///\return true is the packet is compressible, i.e. there are the useful fields that can store the information of the compression
bool isCompressible() { bool isCompressible() {
return compressible; return compressible;
} }
...@@ -127,16 +132,16 @@ public: ...@@ -127,16 +132,16 @@ public:
///Get the tail as a ByteStream ///Get the tail as a ByteStream
ByteStreamPtr getBSTail(); ByteStreamPtr getBSTail();
/// ///Get the header
PacketHeader* getPacketHeader(); PacketHeader* getPacketHeader();
/// ///Get the data field header
DataFieldHeader* getPacketDataFieldHeader(); DataFieldHeader* getPacketDataFieldHeader();
/// ///Get the source data field
SourceDataField* getPacketSourceDataField(); SourceDataField* getPacketSourceDataField();
/// ///Get the tail
PartOfPacket* getPacketTail(); PartOfPacket* getPacketTail();
/// Gets the dimension in byte of the current packet (header + datafield (data field header + sdf + tail) /// Gets the dimension in byte of the current packet (header + datafield (data field header + sdf + tail)
......
...@@ -37,27 +37,28 @@ public: ...@@ -37,27 +37,28 @@ public:
~PacketStream(); ~PacketStream();
/// get a Packet* from a ByteStream /// Get a Packet* from a ByteStream
/// \pre the prefix has been removed /// \param stream the stream that contains the source packet with the prefix
/// \param packet the stream that contains the source packet without the prefix
/// \param decodeType (0) do not decode anything (1) decode only sections (prefix, header, data field header, source data field fixed part, source data field variable part) (2) decode blocks (all sections + all blocks of the ‘source data field variable part’)
Packet* getPacket(ByteStreamPtr stream) throw(PacketException*); Packet* getPacket(ByteStreamPtr stream) throw(PacketException*);
/// Decode a packet and return its pointer
/// \return The index of packet type if it's recognized. 0 if packet isn't recognized. /// \return The index of packet type if it's recognized. 0 if packet isn't recognized.
/// \param prefix A ByteStream that contains the prefix of packet (if present). /// \param prefix A ByteStream that contains the prefix of packet (if present).
/// \param packetHeader A ByteStream that contains the packet header. /// \param packetHeader A ByteStream that contains the packet header.
/// \param packetDataField A ByteStream that contains the packet data field. /// \param packetDataField A ByteStream that contains the packet data field.
int detPacketType(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField); int detPacketType(ByteStreamPtr prefix, ByteStreamPtr packetHeader, ByteStreamPtr packetDataField);
/// Decode a packet and return its pointer
/// \return The index of packet type if it's recognized. 0 if packet isn't recognized. /// \return The index of packet type if it's recognized. 0 if packet isn't recognized.
/// \param prefix A ByteStream that contains the prefix of packet (if present). /// \param prefix A ByteStream that contains the prefix of packet (if present).
/// \param packet A ByteStream that contains the packet. /// \param packet A ByteStream that contains the packet.
int detPacketType(ByteStreamPtr prefix, ByteStreamPtr packet); int detPacketType(ByteStreamPtr prefix, ByteStreamPtr packet);
/// Decode a packet and return its pointer
/// It returns the index of the packet type contained in the stream. The stream* contains also the prefix (if present) /// It returns the index of the packet type contained in the stream. The stream* contains also the prefix (if present)
/// \return The index of packet type if it's recognized. 0 if packet isn't recognized. /// \return The index of packet type if it's recognized. 0 if packet isn't recognized.
/// \param packet A ByteStream pointer that contains the packet. /// \param stream A ByteStream pointer that contains the packet + prefix.
int detPacketType(ByteStreamPtr packet); int detPacketType(ByteStreamPtr stream);
///It returns the total dimension of the packet contained in the stream (without prefix). The stream* contains also the prefix (if present) ///It returns the total dimension of the packet contained in the stream (without prefix). The stream* contains also the prefix (if present)
///\param The stream with the prefix (if present) ///\param The stream with the prefix (if present)
......
...@@ -219,8 +219,6 @@ public: ...@@ -219,8 +219,6 @@ public:
/// \param value The real double precision value /// \param value The real double precision value
virtual void setFieldValue_64f(word index, double value); virtual void setFieldValue_64f(word index, double value);
//--------------------------------
/// Returns the value of a field in the list of fields of this part of packet. /// Returns the value of a field in the list of fields of this part of packet.
/// The value returned is interpreted as a unsigned integer of less of equal 16 bits dimension /// The value returned is interpreted as a unsigned integer of less of equal 16 bits dimension
/// (depends by the size of the field in bits) /// (depends by the size of the field in bits)
...@@ -280,7 +278,6 @@ public: ...@@ -280,7 +278,6 @@ public:
virtual void setFieldValue_16ui(string fieldname, word value); virtual void setFieldValue_16ui(string fieldname, word value);
/// Sets the value of a field. The value is interpreted as a 32 bit signed integer. /// Sets the value of a field. The value is interpreted as a 32 bit signed integer.
/// ---------------------------------
/// This corresponds with the PTC=4, PFC = 14. /// This corresponds with the PTC=4, PFC = 14.
/// See setFieldValue(word index, word value) for general considerations. /// See setFieldValue(word index, word value) for general considerations.
/// \param fieldname Represent the name of the field. /// \param fieldname Represent the name of the field.
...@@ -310,6 +307,7 @@ public: ...@@ -310,6 +307,7 @@ public:
/// \param value The real double precision value /// \param value The real double precision value
virtual void setFieldValue_64f(string fieldname, double value); virtual void setFieldValue_64f(string fieldname, double value);
/// Return the physical index of a field
virtual word getFieldIndex(string fieldname); virtual word getFieldIndex(string fieldname);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment