set sequence flags in space packet base #9

Merged
muellerr merged 2 commits from meier/spacePacketFlag into eive/develop 2021-08-09 11:11:46 +02:00
3 changed files with 23 additions and 0 deletions

View File

@ -32,6 +32,17 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) {
setQueueToUse(queueToUse_); setQueueToUse(queueToUse_);
} }
if(queueToUse == nullptr) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ActionHelper::initialize: No queue set" << std::endl;
#else
sif::printWarning("ActionHelper::initialize: No queue set\n");
#endif
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -54,6 +54,11 @@ void SpacePacketBase::setAPID( uint16_t new_apid ) {
this->data->header.packet_id_l = ( new_apid & 0x00FF ); this->data->header.packet_id_l = ( new_apid & 0x00FF );
} }
void SpacePacketBase::setSequenceFlags( uint8_t sequenceflags ) {
this->data->header.sequence_control_h &= 0x3F;
this->data->header.sequence_control_h |= sequenceflags << 6;
}
uint16_t SpacePacketBase::getPacketSequenceControl( void ) { uint16_t SpacePacketBase::getPacketSequenceControl( void ) {
return ( (this->data->header.sequence_control_h) << 8 ) return ( (this->data->header.sequence_control_h) << 8 )
+ this->data->header.sequence_control_l; + this->data->header.sequence_control_l;

View File

@ -109,6 +109,13 @@ public:
* ignored. * ignored.
*/ */
void setAPID( uint16_t setAPID ); void setAPID( uint16_t setAPID );
/**
* Sets the sequence flags of a packet, which are bit 17 and 18 in the space packet header.
* @param The sequence flags to set
*/
void setSequenceFlags( uint8_t sequenceflags );
/** /**
* Returns the CCSDS packet sequence control field, which are the third and * Returns the CCSDS packet sequence control field, which are the third and
* the fourth byte of the CCSDS primary header. * the fourth byte of the CCSDS primary header.