-
- 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,FullDuplexPacketPortDecorator,FullDuplexTransmissionPortDecorator,LoopbackPort
public interface SerialTransmitter extends org.refcodes.io.BytesTransmitter, SegmentTransmitter, org.refcodes.component.LinkComponent.LinkAutomaton
ASerialTransmitteris 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidflush()default voidtransmitAllBytes(byte[] aBytes)default voidtransmitBytes(byte[] aBytes, int aOffset, int aLength)default <SEGMENT extends Segment>
voidtransmitSegment(SEGMENT aSegment)Transmits aAllocSectionDecoratorSegment(and blocks this thread) till all it'sSequencedata (as ofAbstractLengthDecoratorSegment.toTransmission()) has been sent.voidtransmitSequence(Sequence aSequence)Sends the number of bytes specified.default voidtransmitSequence(Sequence aSequence, int aOffset, int aLength)Transmits aSequence.-
Methods inherited from interface org.refcodes.component.Closable
close, closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isOpened
-
Methods inherited from interface org.refcodes.serial.SegmentTransmitter
doTransmitSegment, doTransmitSegment
-
-
-
-
Method Detail
-
transmitAllBytes
default void transmitAllBytes(byte[] aBytes) throws IOException- Specified by:
transmitAllBytesin interfaceorg.refcodes.io.BytesSource- Throws:
IOException
-
transmitBytes
default void transmitBytes(byte[] aBytes, int aOffset, int aLength) throws IOException- Specified by:
transmitBytesin interfaceorg.refcodes.io.BytesSource- Specified by:
transmitBytesin interfaceorg.refcodes.io.BytesTransmitter- Throws:
IOException
-
transmitSequence
default void transmitSequence(Sequence aSequence, int aOffset, int aLength) throws IOException
Transmits aSequence.- Parameters:
aSequence- TheSequencecontaining 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
Sends the number of bytes specified.- Parameters:
aSequence- TheSequencecontaining 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 aAllocSectionDecoratorSegment(and blocks this thread) till all it'sSequencedata (as ofAbstractLengthDecoratorSegment.toTransmission()) has been sent.- Specified by:
transmitSegmentin interfaceSegmentSource- Type Parameters:
SEGMENT- TheSegmenttype describing theSegmentsubclass used.- Parameters:
aSegment- TheAllocSectionDecoratorSegment's data to be sent with.- Throws:
IOException- thrown in case of I/O issues (e.g. a timeout) while sending.
-
flush
default void flush() throws IOException- Specified by:
flushin interfaceorg.refcodes.io.ByteTransmitter- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceorg.refcodes.component.Flushable- Specified by:
flushin interfaceSegmentTransmitter- Throws:
IOException
-
-