Class SerialP2PHeader

  • All Implemented Interfaces:
    org.refcodes.mixin.DestinationAccessor<Integer>, org.refcodes.mixin.MagicBytesAccessor, org.refcodes.mixin.SourceAccessor<Integer>, org.refcodes.p2p.HopsAccessor<Integer>, org.refcodes.p2p.P2PHeader<Integer>

    public class SerialP2PHeader
    extends org.refcodes.p2p.AbstractP2PHeader<Integer>
    implements org.refcodes.p2p.P2PHeader<Integer>, org.refcodes.mixin.MagicBytesAccessor
    The SerialP2PHeader represents a P2PHeader optimized for local microcontroller wiring (networks) and microcontroller memory layout.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DestinationAccessor

        org.refcodes.mixin.DestinationAccessor.DestinationMutator<DEST extends Object>, org.refcodes.mixin.DestinationAccessor.DestinationProperty<DEST extends Object>
      • Nested classes/interfaces inherited from interface org.refcodes.p2p.HopsAccessor

        org.refcodes.p2p.HopsAccessor.HopsBuilder<LOCATOR extends Object,​B extends org.refcodes.p2p.HopsAccessor.HopsBuilder<LOCATOR,​B>>, org.refcodes.p2p.HopsAccessor.HopsMutator<LOCATOR extends Object>, org.refcodes.p2p.HopsAccessor.HopsProperty<LOCATOR extends Object>
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.MagicBytesAccessor

        org.refcodes.mixin.MagicBytesAccessor.MagicBytesBuilder<B extends org.refcodes.mixin.MagicBytesAccessor.MagicBytesBuilder<B>>, org.refcodes.mixin.MagicBytesAccessor.MagicBytesMutator, org.refcodes.mixin.MagicBytesAccessor.MagicBytesProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.SourceAccessor

        org.refcodes.mixin.SourceAccessor.SourceMutator<SRC extends Object>, org.refcodes.mixin.SourceAccessor.SourceProperty<SRC extends Object>
    • Field Summary

      • Fields inherited from class org.refcodes.p2p.AbstractP2PHeader

        _destination, _hops
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getMagicBytes()
      protected void setHops​(int[] aHops)
      Hook to set the stop-over trail e.g. upon receiving serial data from a port.
      protected void setHops​(Integer[] aHops)
      Hook to set the stop-over trail e.g. upon receiving serial data from a port.
      • Methods inherited from class org.refcodes.p2p.AbstractP2PHeader

        appendHop, getDestination, getHops, getSource, toString
      • Methods inherited from interface org.refcodes.mixin.DestinationAccessor

        getDestination
      • Methods inherited from interface org.refcodes.p2p.P2PHeader

        appendHop, containsHop, getHops
      • Methods inherited from interface org.refcodes.mixin.SourceAccessor

        getSource
    • Constructor Detail

      • SerialP2PHeader

        public SerialP2PHeader​(Integer aDestination)
      • SerialP2PHeader

        public SerialP2PHeader​(byte[] aMagicBytes,
                               Integer aDestination)
        Parameters:
        aMagicBytes - The magic bytes to prefix to this message when being transmitted.
    • Method Detail

      • getMagicBytes

        public byte[] getMagicBytes()
        Specified by:
        getMagicBytes in interface org.refcodes.mixin.MagicBytesAccessor
      • setHops

        protected void setHops​(int[] aHops)
        Hook to set the stop-over trail e.g. upon receiving serial data from a port.
        Parameters:
        aHops - The stop over trail to be set.
      • setHops

        protected void setHops​(Integer[] aHops)
        Hook to set the stop-over trail e.g. upon receiving serial data from a port.
        Parameters:
        aHops - The stop over trail to be set.