/******************************************************************************
**  Function:  CFE_SB_SetMsgSeqCnt()
**
**  Purpose:
**    SB internal function to set the sequence count of a message to a
**    particular value.
**
**  Arguments:
**    MsgPtr  : pointer to the message
**    Count   : sets the sequence count to this value
**
**  Return:
**    None
*/
void CFE_SB_SetMsgSeqCnt(CFE_SB_MsgPtr_t MsgPtr,uint32 Count){

#ifdef MESSAGE_FORMAT_IS_CCSDS
    CCSDS_WR_SEQ(MsgPtr->Hdr,Count);
#endif

}/* end CFE_SB_SetMsgSeqCnt */
예제 #2
0
void CCSDS_InitPkt (CCSDS_PriHdr_t  *PktPtr,
                    uint16           StreamId,
                    uint16           Length,
                    boolean          Clear )
{
   uint16     SeqCount;

   /* Save the sequence count in case it must be preserved. */
   SeqCount = CCSDS_RD_SEQ(*PktPtr);

   /* Zero the entire packet if needed. */
   if (Clear)  memset((void *)PktPtr, 0, Length);

   /* Clear the primary header. */
   CCSDS_CLR_PRI_HDR(*PktPtr);

   /* Set the stream ID and length fields in the primary header. */
   CCSDS_WR_SID(*PktPtr, StreamId);
   CCSDS_WR_LEN(*PktPtr, Length);

   /* Restore the sequence count if needed. */
   if (!Clear)  CCSDS_WR_SEQ(*PktPtr, SeqCount);

} /* END CCSDS_InitPkt() */