Merge branch 'mueller/tm-stack-robustness' into mueller/master
This commit is contained in:
commit
98deac1ef1
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user