java.lang.Object
org.refcodes.p2p.AbstractP2PTail<Integer>
org.refcodes.p2p.alt.serial.SerialP2PTail
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.Schemable<org.refcodes.serial.SerialSchema>
,org.refcodes.mixin.SourceAccessor<Integer>
,org.refcodes.p2p.HopsAccessor<Integer>
,org.refcodes.p2p.P2PTail<Integer>
,org.refcodes.serial.Segment
,org.refcodes.serial.Segment.SegmentMixin
,org.refcodes.serial.Transmission
,org.refcodes.serial.Transmission.TransmissionMixin
public class SerialP2PTail
extends org.refcodes.p2p.AbstractP2PTail<Integer>
implements org.refcodes.p2p.P2PTail<Integer>, org.refcodes.serial.Segment, org.refcodes.serial.Segment.SegmentMixin
The
SerialP2PTail
represents a P2PHeader
optimized for local
microcontroller wiring (networks) and microcontroller memory layout: The hops
(as of AbstractP2PTail.getHops()
are serialized and deserialized in the tail of the
SerialP2PMessage
suffixed with the CRC checksum, as this makes append
the last hop and recalculate the CRC checksum easier for devices with small
memory buffers.- See Also:
-
Nested Class Summary
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.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.Segment
org.refcodes.serial.Segment.SegmentMixin
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>
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
org.refcodes.serial.Transmission.TransmissionMixin
-
Field Summary
Fields inherited from class org.refcodes.p2p.AbstractP2PTail
_hops
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
fromTransmission
(org.refcodes.serial.Sequence aSequence, int aOffset) int
void
receiveFrom
(InputStream aInputStream, OutputStream aReturnStream) org.refcodes.serial.SerialSchema
toSchema()
org.refcodes.serial.Sequence
org.refcodes.struct.SimpleTypeMap
void
transmitTo
(OutputStream aOutputStream, InputStream aReturnStream) Methods inherited from class org.refcodes.p2p.AbstractP2PTail
getHops, getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.p2p.P2PTail
containsHop, getHops
Methods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
Methods inherited from interface org.refcodes.mixin.SourceAccessor
getSource
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Method Details
-
getLength
public int getLength()- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceorg.refcodes.serial.Transmission
-
toSequence
public org.refcodes.serial.Sequence toSequence()- Specified by:
toSequence
in interfaceorg.refcodes.serial.Transmission
-
transmitTo
- Specified by:
transmitTo
in interfaceorg.refcodes.serial.Transmission
- Specified by:
transmitTo
in interfaceorg.refcodes.serial.Transmission.TransmissionMixin
- Throws:
IOException
-
toSchema
public org.refcodes.serial.SerialSchema toSchema()- Specified by:
toSchema
in interfaceorg.refcodes.mixin.Schemable<org.refcodes.serial.SerialSchema>
- Specified by:
toSchema
in interfaceorg.refcodes.serial.Transmission
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()- Specified by:
toSimpleTypeMap
in interfaceorg.refcodes.serial.Transmission
-
fromTransmission
public int fromTransmission(org.refcodes.serial.Sequence aSequence, int aOffset) throws org.refcodes.serial.TransmissionException - Specified by:
fromTransmission
in interfaceorg.refcodes.serial.Segment
- Throws:
org.refcodes.serial.TransmissionException
-
receiveFrom
public void receiveFrom(InputStream aInputStream, OutputStream aReturnStream) throws IOException, org.refcodes.serial.TransmissionException - Specified by:
receiveFrom
in interfaceorg.refcodes.serial.Segment
- Specified by:
receiveFrom
in interfaceorg.refcodes.serial.Segment.SegmentMixin
- Throws:
IOException
org.refcodes.serial.TransmissionException
-
appendHop
-