gov.nasa.gsfc.drl.rtstps.core.output
Class AbstractPacketChannel
java.lang.Object
gov.nasa.gsfc.drl.rtstps.core.RtStpsNode
gov.nasa.gsfc.drl.rtstps.core.output.AbstractChannel
gov.nasa.gsfc.drl.rtstps.core.output.AbstractPacketChannel
- All Implemented Interfaces:
- PacketReceiver, Receiver, java.lang.Cloneable
- Direct Known Subclasses:
- PacketChannel, PacketChannelA, PacketChannelB
public abstract class AbstractPacketChannel
- extends AbstractChannel
- implements PacketReceiver, java.lang.Cloneable
This packet output channel writes packets to the output stream.
Fields inherited from class gov.nasa.gsfc.drl.rtstps.core.output.AbstractChannel |
AFTER, annotationOption, BEFORE, CONSECUTIVE_PERMITTED_ERRORS, consecutiveErrors, count, device, dicardedCount, FRAME, GENERIC, NO_ANNOTATION, output, outputErrorCount, PACKET, unitType |
Method Summary |
abstract void |
putPacket(Packet packet)
Give a packet to this PacketReceiver. |
void |
putPackets(Packet[] packets)
Give an array of packets to this PacketReceiver. |
protected void |
writePacketAnnotation(Packet packet)
Format the packet annotation into a 32-bit integer and write it to the
data output stream. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractPacketChannel
protected AbstractPacketChannel(java.lang.String elementName)
- A constructor.
putPacket
public abstract void putPacket(Packet packet)
throws RtStpsException
- Give a packet to this PacketReceiver.
- Specified by:
putPacket
in interface PacketReceiver
- Throws:
RtStpsException
putPackets
public final void putPackets(Packet[] packets)
throws RtStpsException
- Give an array of packets to this PacketReceiver.
- Specified by:
putPackets
in interface PacketReceiver
- Throws:
RtStpsException
writePacketAnnotation
protected void writePacketAnnotation(Packet packet)
throws java.io.IOException
- Format the packet annotation into a 32-bit integer and write it to the
data output stream. The integer has the following format:
bit 17 1= packet has invalid length, which is outside the configured
minimum and maximum packet length for this packet stream.
bit 16 1= this packet could not be constructed in its entirety,
and so it has appended fill data.
bits 15-0 The number of "good" bytes in this packet. For complete
packets, it is the packet length. For packets with fill,
it is the index of the first fill byte.
- Throws:
java.io.IOException