|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.core.Unit
gov.nasa.gsfc.drl.rtstps.core.ccsds.Packet
public final class Packet
This class contains a single CCSDS packet. The software usually reuses all Packet objects, so you should not save a reference to a Packet in the expectations that the contents will not change.
Nested Class Summary | |
---|---|
class |
Packet.Annotation
Packet annotation. |
Field Summary | |
---|---|
private Packet.Annotation |
annotation
This is packet annotation associated with this packet. |
static int |
IDLE_PACKET
|
static int |
LENGTH_OFFSET
|
static int |
PRIMARY_HEADER_LENGTH
|
Fields inherited from class gov.nasa.gsfc.drl.rtstps.core.Unit |
---|
data, deleted, frameAnnotation, length, startOffset |
Constructor Summary | |
---|---|
Packet(int length)
Constructor to creating a "copy" packet. |
|
Packet(int offset,
byte[] data)
Alternate constructor for creating a "no copy" packet. |
Method Summary | |
---|---|
private long |
calcTimeStamp(int offset,
int timeStampSize)
|
int |
getApplicationId()
Get this packet's application ID. |
static int |
getApplicationId(int offset,
byte[] data)
Static version to get a packet's application ID from a data buffer |
Packet.Annotation |
getPacketAnnotation()
Get this packet's annotation. |
int |
getPacketLength()
Get the packet length field from the header |
static int |
getPacketLength(int offset,
byte[] data)
Static version of getPacketLength(), requires data and index into to be passed in. |
int |
getPacketSize()
Get the total packet size, including header and body |
static int |
getPacketSize(int offset,
byte[] data)
Static version of getPacketSize(), requires data and index into to be passed in. |
int |
getSequenceCounter()
Get this packet's sequence counter. |
static int |
getSequenceCounter(int offset,
byte[] data)
Get this packet's sequence counter from a data buffer |
int |
getSequenceFlags()
Get sequence flags... |
static int |
getSequenceFlags(int offset,
byte[] data)
Get sequence flags from a data buffer |
long |
getTimeStamp(int timeStampSize)
Supports 8 bytes or less in the secondary header |
static long |
getTimeStamp(int offset,
byte[] data,
int timeStampSize)
Supports 8 bytes or less in the secondary header from a data buffer |
long |
getTimeStamp(int offset,
int timeStampSize)
|
int |
getType()
Get the type field... |
int |
getType(int offset,
byte[] data)
Get the type field from a data buffer |
int |
getVersion()
Get the version field... |
int |
getVersion(int offset,
byte[] data)
Get the version field from a data buffer |
boolean |
hasSecondaryHeader()
Check secondary header flags |
static boolean |
hasSecondaryHeader(int offset,
byte[] data)
Check secondary header flags from a data buffer |
java.lang.String |
hdrToString()
|
boolean |
isFirstPacketInSequence()
Check that this packet is the first in a series |
static boolean |
isFirstPacketInSequence(int offset,
byte[] data)
Check that this packet is the first in a series from a data buffer |
boolean |
isLastPacketInSequence()
Check that this packet is the last in a series |
boolean |
isLastPacketInSequence(int offset,
byte[] data)
Check that this packet is the last in a series from a data buffer |
boolean |
isMiddlePacketInSequence()
Check that this packet is the middle in a series |
static boolean |
isMiddlePacketInSequence(int offset,
byte[] data)
Check that this packet is the middle in a series from a data buffer |
boolean |
isStandalonePacket()
Check that this packet is the last in a series |
boolean |
isStandalonePacket(int offset,
byte[] data)
Check that this packet is the last in a series from a data buffer |
void |
reset(int length)
Reset this packet so that it may be used to contain a different packet. |
void |
setLength(int length)
|
void |
setStartOffset(int offset)
|
java.lang.String |
toString()
Get debug information. |
Methods inherited from class gov.nasa.gsfc.drl.rtstps.core.Unit |
---|
getData, getFrameAnnotation, getSize, getStartOffset, isDeleted, setDeleted, setFrameAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int PRIMARY_HEADER_LENGTH
public static final int LENGTH_OFFSET
public static final int IDLE_PACKET
private Packet.Annotation annotation
Constructor Detail |
---|
public Packet(int length)
length
- the packet length in bytespublic Packet(int offset, byte[] data)
offset
- offset into the data buffer the packet data startsdata
- the data byte arrayMethod Detail |
---|
public void setStartOffset(int offset)
public void setLength(int length)
public void reset(int length)
length
- The length of the new packetpublic final int getApplicationId()
getApplicationId
in interface PacketI
public static final int getApplicationId(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getSequenceCounter()
getSequenceCounter
in interface PacketI
public static final int getSequenceCounter(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final boolean hasSecondaryHeader()
hasSecondaryHeader
in interface PacketI
public static final boolean hasSecondaryHeader(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final boolean isFirstPacketInSequence()
isFirstPacketInSequence
in interface PacketI
public static final boolean isFirstPacketInSequence(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final boolean isMiddlePacketInSequence()
isMiddlePacketInSequence
in interface PacketI
public static final boolean isMiddlePacketInSequence(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final boolean isLastPacketInSequence()
isLastPacketInSequence
in interface PacketI
public final boolean isLastPacketInSequence(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final boolean isStandalonePacket()
isStandalonePacket
in interface PacketI
public final boolean isStandalonePacket(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getPacketLength()
getPacketLength
in interface PacketI
public static final int getPacketLength(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getPacketSize()
getPacketSize
in interface PacketI
public static final int getPacketSize(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getSequenceFlags()
getSequenceFlags
in interface PacketI
public static final int getSequenceFlags(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getType()
getType
in interface PacketI
public final int getType(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public final int getVersion()
getVersion
in interface PacketI
public final int getVersion(int offset, byte[] data)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet values
public long getTimeStamp(int timeStampSize)
timeStampSize
-
public long getTimeStamp(int offset, int timeStampSize)
private long calcTimeStamp(int offset, int timeStampSize)
public static long getTimeStamp(int offset, byte[] data, int timeStampSize)
offset
- index into byte[] where packet startsdata
- the byte[] array of the packet valuestimeStampSize
-
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String hdrToString()
public final Packet.Annotation getPacketAnnotation()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |