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.Resetable,org.refcodes.schema.Schemable,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.ClearToSendMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendSegmentPackagerAccessor
ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B extends ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B>>, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerMutator, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendTimeoutMillisAccessor
ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B extends ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B>>, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisMutator, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisPropertyNested 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.EnquiryStandbyTimeMillisPropertyNested 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.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendMagicBytesAccessor
ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B extends ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B>>, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesMutator, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendRetryNumberAccessor
ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B extends ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B>>, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberMutator, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendSegmentPackagerAccessor
ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B extends ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B>>, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerMutator, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendTimeoutMillisAccessor
ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B extends ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B>>, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisMutator, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected MagicBytesSegmentprotected Segmentprotected SegmentPackagerprotected longprotected DECORATEEprotected longprotected byte[]protected MagicBytesSegmentprotected intprotected Segmentprotected SegmentPackagerprotected longstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates a new abstract ready to send transmission decorator.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 TypeMethodDescriptionbooleanbyte[]Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.Retrieves theSegmentPackagerCTS ("clear-to-send") property.longThe CTS ("clear-to-send") timeout attribute in milliseconds.longThe ENQ ("enquiry") timeout attribute in milliseconds.intDetermines the overall length of thisTransmission.byte[]Retrieves the magic bytes from the RTS ("ready-to-send") magic bytes property.intRetrieves the number of retries from the RTS ("ready-to-send") retry number.Retrieves theSegmentPackagerRTS ("ready-to-send") property.longThe RTS ("ready-to-send") timeout attribute in milliseconds.inthashCode()protected voidreceiveCtsTransmitTo(OutputStream aOutputStream, InputStream aReturnStream) Receive CTS transmit to.voidreset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!)toSchema()Provides theSequencerepresentation of thisTransmission.org.refcodes.struct.SimpleTypeMapReturns theSimpleTypeMaprepresentation of thisTransmission.toString()voidtransmitTo(OutputStream aOutputStream, InputStream aReturnStream) Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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()Instantiates a new abstract ready to send transmission decorator. -
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) Constructs an according control-flow decorator instance wrapping the given decoratee. The configuration attributes are taken from theTransmissionMetricsconfiguration 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- TheTransmissionMetricsto 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 RTSSegmentPackagerfor packaging RTS responses.aClearToSendMagicBytes- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager- The CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor packaging RTS responses.aClearToSendMagicBytes- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager- The CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor packaging RTS responses.aClearToSendMagicBytes- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager- The CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor packaging RTS responses.aClearToSendMagicBytes- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager- The CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor 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 RTSSegmentPackagerfor 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 CTSSegmentPackagerfor packaging CTS responses.
-
-
Method Details
-
transmitTo
Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream. Implementations providing error correction methods use the provided feedbackInputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Specified by:
transmitToin interfaceTransmission- Specified by:
transmitToin interfaceTransmission.TransmissionMixin- Parameters:
aOutputStream- TheOutputStreamwhere to write this instance'sSequenceto.aReturnStream- AnInputStreambeing 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 theOutputStreamcaused problems.
-
receiveCtsTransmitTo
protected void receiveCtsTransmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException Receive CTS transmit to.- Parameters:
aOutputStream- the output streamaReturnStream- the return stream- Throws:
IOException- Signals that an I/O exception has occurred.TransmissionException- the transmission exceptionFlowControlTimeoutException- the flow control timeout exception
-
reset
public void reset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!) reset any configurations or settings required to produce the dynamic data (e.g. theTransmissionMetrics).- Specified by:
resetin interfaceorg.refcodes.mixin.Resetable- Specified by:
resetin interfaceTransmission
-
toSchema
- Specified by:
toSchemain interfaceorg.refcodes.schema.Schemable- Specified by:
toSchemain interfaceTransmission
-
getEnquiryStandbyTimeMillis
public long getEnquiryStandbyTimeMillis()The ENQ ("enquiry") timeout attribute in milliseconds.- Specified by:
getEnquiryStandbyTimeMillisin 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:
getReadyToSendTimeoutMillisin 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:
getReadyToSendMagicBytesin 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:
getReadyToSendRetryNumberin interfaceReadyToSendRetryNumberAccessor- Returns:
- The number of retries stored by the RTS ("ready-to-send") retry number.
-
getReadyToSendSegmentPackager
Retrieves theSegmentPackagerRTS ("ready-to-send") property.- Specified by:
getReadyToSendSegmentPackagerin interfaceReadyToSendSegmentPackagerAccessor- Returns:
- The
SegmentPackagerstored by the RTS ("ready-to-send")SegmentPackagerproperty.
-
getClearToSendMagicBytes
public byte[] getClearToSendMagicBytes()Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.- Specified by:
getClearToSendMagicBytesin 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:
getClearToSendTimeoutMillisin interfaceClearToSendTimeoutMillisAccessor- Returns:
- An integer with the CTS ("clear-to-send") timeout in milliseconds.
-
getClearToSendSegmentPackager
Retrieves theSegmentPackagerCTS ("clear-to-send") property.- Specified by:
getClearToSendSegmentPackagerin interfaceClearToSendSegmentPackagerAccessor- Returns:
- The
SegmentPackagerstored by the CTS ("clear-to-send")SegmentPackagerproperty.
-
getLength
public int getLength()Determines the overall length of thisTransmission. In case of nestedTransmissioninstances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLengthin interfaceorg.refcodes.mixin.LengthAccessor- Specified by:
getLengthin interfaceTransmission- Returns:
- The (overall) length of the
Transmission(including any sub-segments).
-
toSequence
Provides theSequencerepresentation of thisTransmission. In case of nestedTransmissioninstances, allSequencerepresentations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmissioninstances) may be backed by the returnedSequence.- Specified by:
toSequencein interfaceTransmission- Returns:
- The according instance's
Sequence.
-
getDecoratee
- Specified by:
getDecorateein interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMaprepresentation of thisTransmission. In case this Transmission hasTransmissionchildren, then the children are queried as well and contained in the resultingSimpleTypeMap. The aliases of the accordingTransmissioninstances represent the resulting path to aTransmission's final simple type.- Specified by:
toSimpleTypeMapin interfaceTransmission- Returns:
- The
SimpleTypeMaprepresenting thisTransmissionand (if any) its children, with the according aliases forming the paths to theTransmission's values.
-