Package org.yamcs.tctm
Class CcsdsPacket
java.lang.Object
org.yamcs.tctm.CcsdsPacket
- Direct Known Subclasses:
SimulatorCcsdsPacket
CCSDS Packet as per CCSDS 133.0-B-2 https://public.ccsds.org/Pubs/133x0b2e1.pdf
primary header (6 bytes): 3 bit = version - 0 1 bit = type (0 = TM, 1= TC) 1 bit = 2nd header present 11 bit = apid 2 bit = grouping, 01 = first, 00 = cont, 10 = last packet of group, 11 = unsegmented data 14 bit = seq 16 bit = packet length (excluding primary header) minus 1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
getAPID()
static short
getAPID
(byte[] packet) static short
getAPID
(ByteBuffer bb) byte[]
getBytes()
int
static int
getCccsdsPacketLength
(byte[] buf) static int
boolean
static boolean
getChecksumIndicator
(byte[] packet) long
int
returns the length of the packet, normally equals ccsdslength+7int
static boolean
getSecondaryHeaderFlag
(byte[] packet) int
static int
getSequenceCount
(byte[] packet) static short
int
void
setAPID
(int apid) void
setCccsdsPacketLength
(short length) void
setHeader
(int apid, int tmtc, int secHeaderPresent, int seqFlags, int seq) Write the header.void
setSequenceCount
(short seqCount) toString()
-
Field Details
-
bb
-
-
Constructor Details
-
CcsdsPacket
public CcsdsPacket(byte[] packet) -
CcsdsPacket
-
-
Method Details
-
getSecondaryHeaderFlag
public int getSecondaryHeaderFlag() -
getSecondaryHeaderFlag
public static boolean getSecondaryHeaderFlag(byte[] packet) -
getSequenceCount
public int getSequenceCount() -
getSequenceCount
public static int getSequenceCount(byte[] packet) -
setSequenceCount
public void setSequenceCount(short seqCount) -
getSequenceCount
-
getAPID
public int getAPID() -
setHeader
public void setHeader(int apid, int tmtc, int secHeaderPresent, int seqFlags, int seq) Write the header. The grouping is set to 10b = last packet in the group and the length to the capacity of the buffer (minus 7)- Parameters:
apid
-secHeaderPresent
- 1 = present, 0 = absenttmtc
- 0 = tm, 1 = tcseqFlags
- grouping: 01 = first packet, 00 = continuation packet, 10 = last packet of group, 11 = unsegmented dataseq
-
-
setAPID
public void setAPID(int apid) -
getAPID
-
getCccsdsPacketLength
-
getCccsdsPacketLength
public int getCccsdsPacketLength() -
setCccsdsPacketLength
public void setCccsdsPacketLength(short length) -
getLength
public int getLength()returns the length of the packet, normally equals ccsdslength+7 -
getCoarseTime
public long getCoarseTime()- Returns:
- time in seconds since 6 Jan 1980
-
getTimeId
public int getTimeId() -
getChecksumIndicator
public boolean getChecksumIndicator() -
getChecksumIndicator
public static boolean getChecksumIndicator(byte[] packet) -
getBytes
public byte[] getBytes() -
getByteBuffer
-
getAPID
public static short getAPID(byte[] packet) -
getCccsdsPacketLength
public static int getCccsdsPacketLength(byte[] buf) -
toString
-
appendBinaryData
-