Merge branch 'mueller/tm-stack-robustness' into mueller/master

This commit is contained in:
Robin Müller 2021-09-27 11:07:02 +02:00
commit 98deac1ef1
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 179 additions and 175 deletions

View File

@ -19,7 +19,8 @@ public:
/**
* The constructor initializes the packet and sets all header information
* according to the passed parameters.
* @param packetDataLength Sets the packet data length field and therefore specifies the size of the packet.
* @param packetDataLength Sets the packet data length field and therefore specifies
* the size of the packet.
* @param isTelecommand Sets the packet type field to either TC (true) or TM (false).
* @param apid Sets the packet's APID field. The default value describes an idle packet.
* @param sequenceCount ets the packet's Source Sequence Count field.

View File

@ -60,8 +60,9 @@ uint16_t SpacePacketBase::getAPID( void ) const {
}
void SpacePacketBase::setAPID( uint16_t new_apid ) {
//Use first three bits of new APID, but keep rest of packet id as it was (see specification).
this->data->header.packet_id_h = (this->data->header.packet_id_h & 0b11111000) | ( ( new_apid & 0x0700 ) >> 8 );
// Use first three bits of new APID, but keep rest of packet id as it was (see specification).
this->data->header.packet_id_h = (this->data->header.packet_id_h & 0b11111000) |
( ( new_apid & 0x0700 ) >> 8 );
this->data->header.packet_id_l = ( new_apid & 0x00FF );
}
@ -85,7 +86,8 @@ uint16_t SpacePacketBase::getPacketSequenceCount( void ) const {
}
void SpacePacketBase::setPacketSequenceCount( uint16_t new_count) {
this->data->header.sequence_control_h = ( this->data->header.sequence_control_h & 0b11000000 ) | ( ( (new_count%LIMIT_SEQUENCE_COUNT) & 0x3F00 ) >> 8 );
this->data->header.sequence_control_h = ( this->data->header.sequence_control_h & 0b11000000 ) |
( ( (new_count%LIMIT_SEQUENCE_COUNT) & 0x3F00 ) >> 8 );
this->data->header.sequence_control_l = ( (new_count%LIMIT_SEQUENCE_COUNT) & 0x00FF );
}
@ -100,7 +102,7 @@ void SpacePacketBase::setPacketDataLength( uint16_t new_length) {
}
size_t SpacePacketBase::getFullSize() {
//+1 is done because size in packet data length field is: size of data field -1
// +1 is done because size in packet data length field is: size of data field -1
return this->getPacketDataLength() + sizeof(this->data->header) + 1;
}

View File

@ -70,7 +70,8 @@ public:
*/
virtual ~SpacePacketBase();
//CCSDS Methods:
//CCSDS Methods
/**
* Getter for the packet version number field.
* @return Returns the highest three bit of the packet in one byte.
@ -162,7 +163,7 @@ public:
*/
void setPacketDataLength( uint16_t setLength );
//Helper methods:
// Helper methods
/**
* This method returns a raw uint8_t pointer to the packet.
* @return A \c uint8_t pointer to the first byte of the CCSDS primary header.