#include <encap_packet.h>
Public Member Functions | |
Reader & | deserialize (Reader &reader) |
Reader & | deserialize (Reader &reader, size_t length) |
EncapPacket (EIP_UINT command, EIP_UDINT session_handle, shared_ptr< Serializable > payload) | |
EncapPacket (EIP_UINT command=0, EIP_UDINT session_handle=0) | |
EncapHeader & | getHeader () |
size_t | getLength () const |
shared_ptr< Serializable > | getPayload () const |
void | getPayloadAs (Serializable &result) |
Writer & | serialize (Writer &writer) const |
void | setPayload (shared_ptr< Serializable > payload) |
void | updateLength () |
Private Attributes | |
EncapHeader | header_ |
shared_ptr< Serializable > | payload_ |
Representation of an EtherNet/IP Encapsulation Packet
Definition at line 50 of file encap_packet.h.
Construct an encapsulation packet
Definition at line 57 of file encap_packet.h.
|
inline |
Construct an encapsulation packet with a data payload
command | Command ID for the header |
session_handle | Session handle to use in the header |
buf | Data for the payload |
Definition at line 66 of file encap_packet.h.
Deserialize data from the given reader without length information
reader | Reader to use for deserialization |
std::length_error | if the buffer is overrun while deserializing |
Implements eip::serialization::Serializable.
Definition at line 61 of file encap_packet.cpp.
Deserialize packet from the given reader with the max length given
reader | Reader to use for deserialization |
length | Length expected for the packet |
std::length_error | if the buffer is overrun while deserializing |
Implements eip::serialization::Serializable.
Definition at line 77 of file encap_packet.cpp.
|
inline |
Get the header portion of this packet
Definition at line 78 of file encap_packet.h.
|
inlinevirtual |
Get the length of the entire packet, not just the payload
Implements eip::serialization::Serializable.
Definition at line 112 of file encap_packet.h.
|
inline |
Get the data payload from this packet
Definition at line 87 of file encap_packet.h.
void eip::EncapPacket::getPayloadAs | ( | Serializable & | result | ) |
Get the payload as a particular serializable instance
result | Serializable class to get data into |
Definition at line 44 of file encap_packet.cpp.
Serialize the packet to the given writer
writer | The Writer into which to serialize |
Implements eip::serialization::Serializable.
Definition at line 49 of file encap_packet.cpp.
|
inline |
Set the payload for this packet
payload | Payload to use |
Definition at line 96 of file encap_packet.h.
|
inline |
Update the length field of the header. Note that this must be called if the payload size is modified after setting the payload reference.
Definition at line 126 of file encap_packet.h.
|
private |
Definition at line 156 of file encap_packet.h.
|
private |
Definition at line 157 of file encap_packet.h.