Interface SerialTransmitter

All Superinterfaces:
org.refcodes.io.ByteSource, org.refcodes.io.BytesSource, org.refcodes.io.BytesTransmitter, org.refcodes.io.ByteTransmitter, org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionStatusAccessor, Flushable, org.refcodes.component.Flushable, org.refcodes.component.LinkComponent, org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.Openable, org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.OpenedAccessor, org.refcodes.mixin.OutputStreamAccessor, SegmentSource, SegmentTransmitter, org.refcodes.io.Transmittable
All Known Subinterfaces:
Port<PM>, SerialTransceiver
All Known Implementing Classes:
AbstractPort, AbstractPortDecorator, CrossoverLoopbackPort, LoopbackPort

public interface SerialTransmitter extends org.refcodes.io.BytesTransmitter, SegmentTransmitter, org.refcodes.component.LinkComponent.LinkAutomaton
A SerialTransmitter is used to write data to a serial port or the like.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.io.BytesTransmitter

    org.refcodes.io.BytesTransmitter.TransmitterOutputStream

    Nested classes/interfaces inherited from interface org.refcodes.component.Closable

    org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor

    org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent

    org.refcodes.component.ConnectableComponent.ConnectableAutomaton

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor

    org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.Flushable

    org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent

    org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.Openable

    org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

    org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty

    Nested classes/interfaces inherited from interface org.refcodes.mixin.OutputStreamAccessor

    org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<B extends org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<?>>, org.refcodes.mixin.OutputStreamAccessor.OutputStreamMutator, org.refcodes.mixin.OutputStreamAccessor.OutputStreamProperty
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    default void
    transmitBytes(byte[] aBytes)
    default void
    transmitBytes(byte[] aBytes, int aOffset, int aLength)
    default <SEGMENT extends Segment>
    void
    transmitSegment(SEGMENT aSegment)
    Transmits a Segment (and blocks this thread) till all it's Sequence data (as of Transmission.toSequence()) has been sent.
    void
    Transmits a Sequence (and blocks this thread) till all it's data has been sent.
    default void
    transmitSequence(Sequence aSequence, int aOffset, int aLength)
    Transmits a Sequence.

    Methods inherited from interface org.refcodes.io.BytesSource

    transmitByte

    Methods inherited from interface org.refcodes.io.BytesTransmitter

    getOutputStream

    Methods inherited from interface org.refcodes.component.Closable

    close, closeIn, closeQuietly, closeUnchecked

    Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton

    isClosable

    Methods inherited from interface org.refcodes.component.ClosedAccessor

    isClosed

    Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor

    getConnectionStatus, isOpened

    Methods inherited from interface org.refcodes.component.Flushable

    flushUnchecked, isFlushable

    Methods inherited from interface org.refcodes.component.Openable

    open, openUnchecked

    Methods inherited from interface org.refcodes.component.Openable.OpenAutomaton

    isOpenable

    Methods inherited from interface org.refcodes.serial.SegmentTransmitter

    doTransmitSegment, doTransmitSegment
  • Method Details

    • transmitBytes

      default void transmitBytes(byte[] aBytes) throws IOException
      Specified by:
      transmitBytes in interface org.refcodes.io.BytesSource
      Throws:
      IOException
    • transmitBytes

      default void transmitBytes(byte[] aBytes, int aOffset, int aLength) throws IOException
      Specified by:
      transmitBytes in interface org.refcodes.io.BytesSource
      Specified by:
      transmitBytes in interface org.refcodes.io.BytesTransmitter
      Throws:
      IOException
    • transmitSequence

      default void transmitSequence(Sequence aSequence, int aOffset, int aLength) throws IOException
      Transmits a Sequence.
      Parameters:
      aSequence - The Sequence containing the data to be send.
      aOffset - The offset from where to take the chunk data.
      aLength - The number of bytes to take, beginning at the provided offset.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a timeout) while sending
    • transmitSequence

      void transmitSequence(Sequence aSequence) throws IOException
      Transmits a Sequence (and blocks this thread) till all it's data has been sent.
      Parameters:
      aSequence - The Sequence containing the data to be send.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a timeout) while sending
    • transmitSegment

      default <SEGMENT extends Segment> void transmitSegment(SEGMENT aSegment) throws IOException
      Transmits a Segment (and blocks this thread) till all it's Sequence data (as of Transmission.toSequence()) has been sent.
      Specified by:
      transmitSegment in interface SegmentSource
      Type Parameters:
      SEGMENT - The Segment type describing the Segment subclass used.
      Parameters:
      aSegment - The Segment's data to be sent.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a timeout) while sending.
    • flush

      default void flush() throws IOException
      Specified by:
      flush in interface org.refcodes.io.ByteTransmitter
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in interface org.refcodes.component.Flushable
      Specified by:
      flush in interface SegmentTransmitter
      Throws:
      IOException