Class SerialHandshakeSugar
- java.lang.Object
-
- org.refcodes.serial.ext.handshake.SerialHandshakeSugar
-
public class SerialHandshakeSugar extends Object
Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for the construction of various serial types such asSegment
orSection
type instances (and the like).
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SerialHandshakeSugar()
Instantiates a new serial sugar.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort)
Decorates the givenPort
with full duplexSegment
multiplexer functionality.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberInitValue, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberInitValue, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.serial.TransmissionMetrics aTransmissionMetrics)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController<PM>handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.serial.TransmissionMetrics aTransmissionMetrics, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.static <PM extends org.refcodes.serial.PortMetrics>
HandshakePortController.Builder<PM>handshakePortControllerBuilder()
Constructs a builder to build an accordingHandshakePortController
instance.
-
-
-
Method Detail
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort)
Decorates the givenPort
with full duplexSegment
multiplexer functionality.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- the generic type- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- the generic type- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aAcknowledgeTimeoutInMs
- The timeout in milliseconds to pend till the next retry.aSequenceNumberWidth
- The width in bytes to be used for the binary sequence number representation.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aAcknowledgeTimeoutInMs
- The timeout in milliseconds to pend till the next retry.aSequenceNumberWidth
- The width in bytes to be used for the binary sequence number representation.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberInitValue, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aAcknowledgeTimeoutInMs
- The timeout in milliseconds to pend till the next retry.aSequenceNumberInitValue
- The initialization value for the sequence number counter.aSequenceNumberWidth
- The width in bytes to be used for the binary sequence number representation.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, byte[] aTransmissionMagicBytes, byte[] aNoAcknowledgeMagicBytes, byte[] aRequestForAcknowledgeMagicBytes, byte[] aAcknowledgeMagicBytes, int aAcknowledgeRetryNumber, long aAcknowledgeTimeoutInMs, int aSequenceNumberInitValue, int aSequenceNumberWidth, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofHandshakePortController.transmitSegment(Segment)
or the like).aNoAcknowledgeMagicBytes
- the No-Acknowledge magic bytesaRequestForAcknowledgeMagicBytes
- the Request-for-Acknowledge magic bytesaAcknowledgeMagicBytes
- The ACK character(s) to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.aAcknowledgeTimeoutInMs
- The timeout in milliseconds to pend till the next retry.aSequenceNumberInitValue
- The initialization value for the sequence number counter.aSequenceNumberWidth
- The width in bytes to be used for the binary sequence number representation.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.serial.TransmissionMetrics aTransmissionMetrics)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.serial.TransmissionMetrics aTransmissionMetrics, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, org.refcodes.numerical.Endianess aEndianess, org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality as of the given arguments.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aEndianess
- TheEndianess
to use when calculating the CRC checksum.aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortController
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController<PM> handshakePortController(org.refcodes.serial.Port<PM> aPort, ExecutorService aExecutorService)
Decorates the givenPort
with full duplexSegment
multiplexer functionality.- Type Parameters:
PM
- The actualPortMetrics
type to use.- Parameters:
aPort
- ThePort
to be decorated.aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The accordingly created
HandshakePortController
.
-
handshakePortControllerBuilder
public static <PM extends org.refcodes.serial.PortMetrics> HandshakePortController.Builder<PM> handshakePortControllerBuilder()
Constructs a builder to build an accordingHandshakePortController
instance.- Type Parameters:
PM
- the generic type- Returns:
- The accordingly created
HandshakePortController.Builder
.
-
-