Package edu.nps.moves.dis7.pdus
Class SignalPdu
java.lang.Object
edu.nps.moves.dis7.pdus.Pdu
edu.nps.moves.dis7.pdus.PduBase
edu.nps.moves.dis7.pdus.RadioCommunicationsFamilyPdu
edu.nps.moves.dis7.pdus.SignalPdu
- All Implemented Interfaces:
Marshaller
,Serializable
5.8.4 Conveys the audio or digital data carried by the simulated radio or intercom transmission.
IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation - Application Protocols
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
list of eight bit valuesprotected short
length of data in bitsprotected short
encoding scheme used, and enumerationprotected RadioCommsHeader
header is an undescribed parameter...protected int
sample rateprotected short
number of samplesprotected SignalTDLType
tdl type uid 178Fields inherited from class edu.nps.moves.dis7.pdus.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsImpl(Object obj)
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectbyte[]
getData()
Getter fordata
short
Getter fordataLength
short
Getter forencodingScheme
Getter forheader
int
Returns size of this serialized (marshalled) object in bytesint
Getter forsampleRate
short
Getter forsamples
Getter fortdlType
void
marshal(DataOutputStream dos)
Serializes an object to a DataOutputStream.void
marshal(ByteBuffer byteBuffer)
Packs an object into the ByteBuffer.setData(byte[] pData)
Setter fordata
setDataLength(int pDataLength)
Utility setter fordataLength
setDataLength(short pDataLength)
Setter fordataLength
setEncodingScheme(int pEncodingScheme)
Utility setter forencodingScheme
setEncodingScheme(short pEncodingScheme)
Setter forencodingScheme
setHeader(RadioCommsHeader pHeader)
Setter forheader
setSampleRate(int pSampleRate)
Setter forsampleRate
setSamples(int pSamples)
Utility setter forsamples
setSamples(short pSamples)
Setter forsamples
setTdlType(SignalTDLType pTdlType)
Setter fortdlType
toString()
int
unmarshal(DataInputStream dis)
Deserializes an object from a DataInputStream.int
unmarshal(ByteBuffer byteBuffer)
Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.pdus.PduBase
getPadding, getPduStatus, setPadding, setPadding, setPduStatus
Methods inherited from class edu.nps.moves.dis7.pdus.Pdu
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, marshal, setExerciseID, setExerciseID, setLength, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp
-
Field Details
-
header
header is an undescribed parameter... -
encodingScheme
protected short encodingSchemeencoding scheme used, and enumeration -
tdlType
tdl type uid 178 -
sampleRate
protected int sampleRatesample rate -
dataLength
protected short dataLengthlength of data in bits -
samples
protected short samplesnumber of samples -
data
protected byte[] datalist of eight bit values
-
-
Constructor Details
-
SignalPdu
public SignalPdu()Constructor creates and configures a new instance object
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Specified by:
getMarshalledSize
in interfaceMarshaller
- Overrides:
getMarshalledSize
in classRadioCommunicationsFamilyPdu
- Returns:
- serialized size in bytes
- See Also:
- https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
setHeader
Setter forheader
- Parameters:
pHeader
- new value of interest- Returns:
- same object to permit progressive setters
-
getHeader
Getter forheader
- Returns:
- value of interest
-
setEncodingScheme
Setter forencodingScheme
- Parameters:
pEncodingScheme
- new value of interest- Returns:
- same object to permit progressive setters
-
setEncodingScheme
Utility setter forencodingScheme
- Parameters:
pEncodingScheme
- new value of interest- Returns:
- same object to permit progressive setters
-
getEncodingScheme
public short getEncodingScheme()Getter forencodingScheme
- Returns:
- value of interest
-
setTdlType
Setter fortdlType
- Parameters:
pTdlType
- new value of interest- Returns:
- same object to permit progressive setters
-
getTdlType
Getter fortdlType
- Returns:
- value of interest
-
setSampleRate
Setter forsampleRate
- Parameters:
pSampleRate
- new value of interest- Returns:
- same object to permit progressive setters
-
getSampleRate
public int getSampleRate()Getter forsampleRate
- Returns:
- value of interest
-
setDataLength
Setter fordataLength
- Parameters:
pDataLength
- new value of interest- Returns:
- same object to permit progressive setters
-
setDataLength
Utility setter fordataLength
- Parameters:
pDataLength
- new value of interest- Returns:
- same object to permit progressive setters
-
getDataLength
public short getDataLength()Getter fordataLength
- Returns:
- value of interest
-
setSamples
Setter forsamples
- Parameters:
pSamples
- new value of interest- Returns:
- same object to permit progressive setters
-
setSamples
Utility setter forsamples
- Parameters:
pSamples
- new value of interest- Returns:
- same object to permit progressive setters
-
getSamples
public short getSamples()Getter forsamples
- Returns:
- value of interest
-
setData
Setter fordata
- Parameters:
pData
- new value of interest- Returns:
- same object to permit progressive setters
-
getData
public byte[] getData()Getter fordata
- Returns:
- value of interest
-
marshal
Serializes an object to a DataOutputStream.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classRadioCommunicationsFamilyPdu
- Parameters:
dos
- the OutputStream- Throws:
Exception
- if something goes wrong- See Also:
DataOutputStream
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classRadioCommunicationsFamilyPdu
- Parameters:
dis
- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception
- if something goes wrong- See Also:
DataInputStream
, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
marshal
Packs an object into the ByteBuffer.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classRadioCommunicationsFamilyPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException
- if byteBuffer is too smallReadOnlyBufferException
- if byteBuffer is read onlyException
- ByteBuffer-generated exception- See Also:
ByteBuffer
-
unmarshal
Unpacks a Pdu from the underlying data.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classRadioCommunicationsFamilyPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin reading- Returns:
- marshalled serialized size in bytes
- Throws:
BufferUnderflowException
- if byteBuffer is too smallException
- ByteBuffer-generated exception- See Also:
ByteBuffer
, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
equals
- Overrides:
equals
in classRadioCommunicationsFamilyPdu
-
equalsImpl
Description copied from class:Pdu
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Overrides:
equalsImpl
in classRadioCommunicationsFamilyPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
- Overrides:
toString
in classRadioCommunicationsFamilyPdu
-