Class ModemDecoderImpl

java.lang.Object
org.refcodes.io.AbstractBytesDestination
org.refcodes.io.AbstractBytesReceiver
org.refcodes.codec.ModemDecoderImpl
All Implemented Interfaces:
Decoder, DemodulatorStatusAccessor, ModemDecoder, 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, org.refcodes.component.OpenedAccessor, org.refcodes.io.Availability, org.refcodes.io.ByteDestination, org.refcodes.io.ByteReceiver, org.refcodes.io.BytesDestination, org.refcodes.io.BytesReceiver, org.refcodes.io.Receivable, org.refcodes.io.Skippable, org.refcodes.io.TimeoutInputStreamAccessor, org.refcodes.mixin.InputStreamAccessor, org.refcodes.mixin.Loggable
Direct Known Subclasses:
ModemDecoderImpl.ModemByteDecoderProviderImpl, ModemDecoderImpl.ModemShortDecoderProviderImpl

public class ModemDecoderImpl extends org.refcodes.io.AbstractBytesReceiver implements ModemDecoder
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Vanilla plain implementation of the ModemDecoder.ModemByteDecoderProvider interface to be used with BytesDestination (BytesReceiver) instances.
    static class 
    Vanilla plain implementation of the ModemDecoder.ModemByteDecoderProvider interface to be used with BytesDestination (BytesReceiver) instances.

    Nested classes/interfaces inherited from class org.refcodes.io.AbstractBytesReceiver

    org.refcodes.io.AbstractBytesReceiver.ConnectableAutomaton

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

    org.refcodes.io.BytesReceiver.ReceiverInputStream

    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.mixin.InputStreamAccessor

    org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty

    Nested classes/interfaces inherited from interface org.refcodes.codec.ModemDecoder

    ModemDecoder.ModemByteDecoderProvider, ModemDecoder.ModemShortDecoderProvider

    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.io.TimeoutInputStreamAccessor

    org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.refcodes.io.BytesReceiver
     
     
    protected ModemMetrics
     
    protected org.refcodes.io.ShortsReceiver
     

    Fields inherited from class org.refcodes.io.AbstractBytesReceiver

    _automaton

    Fields inherited from class org.refcodes.io.AbstractBytesDestination

    DATAGRAM_QUEUE_SIZE

    Fields inherited from interface org.refcodes.mixin.Loggable

    RUNTIME_LOGGER_CLASS, RUNTIME_LOGGER_FACTORY_CLASS, RUNTIME_LOGGER_FACTORY_METHOD
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesDestination aByteProvider)
    Instantiates a new modem decoder impl.
     
    ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesReceiver aByteReceiver)
    Instantiates a new modem decoder impl.
     
    ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsDestination aShortProvider)
    Instantiates a new modem decoder impl.
     
    ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsReceiver aShortReceiver)
    Instantiates a new modem decoder impl.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Retrieves the Demodulator-Status from the Demodulator-Status property.
    byte[]
    byte
    byte[]
    receiveBytes(int aMaxLength)

    Methods inherited from class org.refcodes.io.AbstractBytesReceiver

    close, getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus

    Methods inherited from class org.refcodes.io.AbstractBytesDestination

    pushDatagram, pushDatagrams, pushDatagrams

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.refcodes.io.Availability

    hasAvailable

    Methods inherited from interface org.refcodes.io.BytesDestination

    receiveBytes

    Methods inherited from interface org.refcodes.io.BytesReceiver

    getInputStream, getInputStream, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip

    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.mixin.Loggable

    alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn

    Methods inherited from interface org.refcodes.io.Skippable

    skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin, skipAvailableWithin
  • Field Details

    • _modemMetrics

      protected ModemMetrics _modemMetrics
    • _datagramQueue

      protected LinkedBlockingQueue<Byte> _datagramQueue
    • _byteReceiver

      protected org.refcodes.io.BytesReceiver _byteReceiver
    • _shortReceiver

      protected org.refcodes.io.ShortsReceiver _shortReceiver
  • Constructor Details

    • ModemDecoderImpl

      public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesDestination aByteProvider)
      Instantiates a new modem decoder impl.
      Parameters:
      aModemMetrics - the modem metrics
      aByteProvider - the byte provider
    • ModemDecoderImpl

      public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsDestination aShortProvider)
      Instantiates a new modem decoder impl.
      Parameters:
      aModemMetrics - the modem metrics
      aShortProvider - the short provider
    • ModemDecoderImpl

      public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsReceiver aShortReceiver)
      Instantiates a new modem decoder impl.
      Parameters:
      aModemMetrics - the modem metrics
      aShortReceiver - the short receiver
    • ModemDecoderImpl

      public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesReceiver aByteReceiver)
      Instantiates a new modem decoder impl.
      Parameters:
      aModemMetrics - the modem metrics
      aByteReceiver - the byte receiver
    • ModemDecoderImpl

      protected ModemDecoderImpl(ModemMetrics aModemMetrics)
  • Method Details

    • receiveAllBytes

      public byte[] receiveAllBytes()
      Specified by:
      receiveAllBytes in interface org.refcodes.io.BytesDestination
      Specified by:
      receiveAllBytes in interface org.refcodes.io.BytesReceiver
      Overrides:
      receiveAllBytes in class org.refcodes.io.AbstractBytesReceiver
    • available

      public int available()
      Specified by:
      available in interface org.refcodes.io.Availability
      Specified by:
      available in interface org.refcodes.io.Skippable
      Overrides:
      available in class org.refcodes.io.AbstractBytesReceiver
    • receiveBytes

      public byte[] receiveBytes(int aMaxLength)
      Specified by:
      receiveBytes in interface org.refcodes.io.BytesDestination
      Specified by:
      receiveBytes in interface org.refcodes.io.BytesReceiver
      Overrides:
      receiveBytes in class org.refcodes.io.AbstractBytesReceiver
    • receiveByte

      public byte receiveByte() throws IOException
      Specified by:
      receiveByte in interface org.refcodes.io.ByteDestination
      Specified by:
      receiveByte in interface org.refcodes.io.BytesDestination
      Overrides:
      receiveByte in class org.refcodes.io.AbstractBytesReceiver
      Throws:
      IOException
    • getDemodulatorStatus

      public DemodulatorStatus getDemodulatorStatus()
      Retrieves the Demodulator-Status from the Demodulator-Status property.
      Specified by:
      getDemodulatorStatus in interface DemodulatorStatusAccessor
      Returns:
      The Demodulator-Status stored by the Demodulator-Status property.