Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractReadyToSendTransmissionDecorator<DECORATEE extends Transmission>
java.lang.Object
org.refcodes.serial.AbstractReadyToSendTransmissionDecorator<DECORATEE>
- Type Parameters:
DECORATEE
- The decoratee type describing the according subclass to be enriched.
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.DecorateeAccessor<DECORATEE>
,org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.Schemable<SerialSchema>
,ClearToSendMagicBytesAccessor
,ClearToSendSegmentPackagerAccessor
,ClearToSendTimeoutMillisAccessor
,EnquiryStandbyTimeMillisAccessor
,ReadyToSendMagicBytesAccessor
,ReadyToSendRetryNumberAccessor
,ReadyToSendSegmentPackagerAccessor
,ReadyToSendTimeoutMillisAccessor
,ReadyToSendTransmission
,Transmission
,Transmission.TransmissionMixin
- Direct Known Subclasses:
ReadyToSendSectionDecorator
,ReadyToSendSegmentDecorator
public abstract class AbstractReadyToSendTransmissionDecorator<DECORATEE extends Transmission>
extends Object
implements ReadyToSendTransmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
The
AbstractReadyToSendTransmissionDecorator
class implements a
decorator providing ReadyToSendTransmission
functionality for a
Transmission
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendMagicBytesAccessor
ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B extends ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B>>, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesMutator, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendSegmentPackagerAccessor
ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B extends ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B>>, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerMutator, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendTimeoutMillisAccessor
ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B extends ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B>>, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisMutator, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,
B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE, B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object> Nested classes/interfaces inherited from interface org.refcodes.serial.EnquiryStandbyTimeMillisAccessor
EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B extends EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B>>, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisMutator, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendMagicBytesAccessor
ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B extends ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B>>, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesMutator, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendRetryNumberAccessor
ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B extends ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B>>, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberMutator, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendSegmentPackagerAccessor
ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B extends ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B>>, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerMutator, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendTimeoutMillisAccessor
ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B extends ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B>>, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisMutator, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
protected MagicBytesSegment
protected Segment
protected SegmentPackager
protected long
protected DECORATEE
protected long
protected byte[]
protected MagicBytesSegment
protected int
protected Segment
protected SegmentPackager
protected long
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator
(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) Constructs an according control-flow decorator instance wrapping the given decoratee. -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.Retrieves theSegmentPackager
CTS ("clear-to-send") property.long
The CTS ("clear-to-send") timeout attribute in milliseconds.long
The ENQ ("enquiry") timeout attribute in milliseconds.int
Determines the overall length of thisTransmission
.byte[]
Retrieves the magic bytes from the RTS ("ready-to-send") magic bytes property.int
Retrieves the number of retries from the RTS ("ready-to-send") retry number.Retrieves theSegmentPackager
RTS ("ready-to-send") property.long
The RTS ("ready-to-send") timeout attribute in milliseconds.int
hashCode()
protected void
receiveCtsTransmitTo
(OutputStream aOutputStream, InputStream aReturnStream) toSchema()
Retrieves theSerialSchema
representing theTransmission
.Provides theSequence
representation of thisTransmission
.org.refcodes.struct.SimpleTypeMap
Returns theSimpleTypeMap
representation of thisTransmission
.toString()
void
transmitTo
(OutputStream aOutputStream, InputStream aReturnStream) Transmits theSequence
representing the implementing type's instance to the givenOutputStream
.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Field Details
-
RTS_MAGIC_BYTES
- See Also:
-
RTS_TIMEOUT_IN_MS
- See Also:
-
RTS_RETRY_NUMBER
- See Also:
-
CTS_MAGIC_BYTES
- See Also:
-
CTS_TIMEOUT_IN_MS
- See Also:
-
_decoratee
-
_enquiryStandbyTimeInMs
protected long _enquiryStandbyTimeInMs -
_clearToSendTimeoutInMs
protected long _clearToSendTimeoutInMs -
_clearToSendMagicBytes
protected byte[] _clearToSendMagicBytes -
_clearToSendMagicBytesSegment
-
_clearToSendSegment
-
_clearToSendSegmentPackager
-
_readyToSendTimeoutInMs
protected long _readyToSendTimeoutInMs -
_readyToSendMagicBytes
protected byte[] _readyToSendMagicBytes -
_readyToSendSegmentPackager
-
_readyToSendRetryNumber
protected int _readyToSendRetryNumber -
_readyToSendMagicBytesSegment
-
_readyToSendSegment
-
-
Constructor Details
-
AbstractReadyToSendTransmissionDecorator
protected AbstractReadyToSendTransmissionDecorator() -
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) Constructs an according control-flow decorator instance wrapping the given decoratee. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aDecoratee
- The decoratee to be wrapped by the control-flow decorator.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
AbstractReadyToSendTransmissionDecorator
Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes no timeout (blocking mode).
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs
- The timeout in milliseconds to wait for an RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a CTS response (transmitter) from the receiver after signaling a RTS ("ready-to-send") to the receiver.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
-
Method Details
-
transmitTo
Transmits theSequence
representing the implementing type's instance to the givenOutputStream
. Implementations providing error correction methods use the provided feedbackInputStream
to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Specified by:
transmitTo
in interfaceTransmission
- Specified by:
transmitTo
in interfaceTransmission.TransmissionMixin
- Parameters:
aOutputStream
- TheOutputStream
where to write this instance'sSequence
to.aReturnStream
- AnInputStream
being the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException
- thrown in case writing data to theOutputStream
caused problems.
-
receiveCtsTransmitTo
protected void receiveCtsTransmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException, TransmissionException, FlowControlTimeoutException -
toSchema
Retrieves theSerialSchema
representing theTransmission
. Retrieving aSerialSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Specified by:
toSchema
in interfaceorg.refcodes.mixin.Schemable<DECORATEE extends Transmission>
- Specified by:
toSchema
in interfaceTransmission
- Returns:
- The
SerialSchema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
getEnquiryStandbyTimeMillis
public long getEnquiryStandbyTimeMillis()The ENQ ("enquiry") timeout attribute in milliseconds.- Specified by:
getEnquiryStandbyTimeMillis
in interfaceEnquiryStandbyTimeMillisAccessor
- Returns:
- An integer with the ENQ ("enquiry") timeout in milliseconds.
-
getReadyToSendTimeoutMillis
public long getReadyToSendTimeoutMillis()The RTS ("ready-to-send") timeout attribute in milliseconds.- Specified by:
getReadyToSendTimeoutMillis
in interfaceReadyToSendTimeoutMillisAccessor
- Returns:
- An integer with the RTS ("ready-to-send") timeout in milliseconds.
-
getReadyToSendMagicBytes
public byte[] getReadyToSendMagicBytes()Retrieves the magic bytes from the RTS ("ready-to-send") magic bytes property.- Specified by:
getReadyToSendMagicBytes
in interfaceReadyToSendMagicBytesAccessor
- Returns:
- The magic bytes stored by the RTS ("ready-to-send") magic bytes property.
-
getReadyToSendRetryNumber
public int getReadyToSendRetryNumber()Retrieves the number of retries from the RTS ("ready-to-send") retry number. A RTS retry number is the overall number of retries to use when counting retries.- Specified by:
getReadyToSendRetryNumber
in interfaceReadyToSendRetryNumberAccessor
- Returns:
- The number of retries stored by the RTS ("ready-to-send") retry number.
-
getReadyToSendSegmentPackager
Retrieves theSegmentPackager
RTS ("ready-to-send") property.- Specified by:
getReadyToSendSegmentPackager
in interfaceReadyToSendSegmentPackagerAccessor
- Returns:
- The
SegmentPackager
stored by the RTS ("ready-to-send")SegmentPackager
property.
-
getClearToSendMagicBytes
public byte[] getClearToSendMagicBytes()Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.- Specified by:
getClearToSendMagicBytes
in interfaceClearToSendMagicBytesAccessor
- Returns:
- The magic bytes stored by the CTS ("clear-to-send") magic bytes property.
-
getClearToSendTimeoutMillis
public long getClearToSendTimeoutMillis()The CTS ("clear-to-send") timeout attribute in milliseconds.- Specified by:
getClearToSendTimeoutMillis
in interfaceClearToSendTimeoutMillisAccessor
- Returns:
- An integer with the CTS ("clear-to-send") timeout in milliseconds.
-
getClearToSendSegmentPackager
Retrieves theSegmentPackager
CTS ("clear-to-send") property.- Specified by:
getClearToSendSegmentPackager
in interfaceClearToSendSegmentPackagerAccessor
- Returns:
- The
SegmentPackager
stored by the CTS ("clear-to-send")SegmentPackager
property.
-
getLength
public int getLength()Determines the overall length of thisTransmission
. In case of nestedTransmission
instances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceTransmission
- Returns:
- The (overall) length of the
Transmission
(including any sub-segments).
-
toSequence
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmission
instances) may be backed by the returnedSequence
.- Specified by:
toSequence
in interfaceTransmission
- Returns:
- The according instance's
Sequence
.
-
getDecoratee
- Specified by:
getDecoratee
in interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMap
representation of thisTransmission
. In case this Transmission hasTransmission
children, then the children are queried as well and contained in the resultingSimpleTypeMap
. The aliases of the accordingTransmission
instances represent the resulting path to aTransmission
's final simple type.- Specified by:
toSimpleTypeMap
in interfaceTransmission
- Returns:
- The
SimpleTypeMap
representing thisTransmission
and (if any) its children, with the according aliases forming the paths to theTransmission
's values.
-