#include <encap_packet.h>
Representation of an EtherNet/IP Encapsulation Packet
Definition at line 50 of file encap_packet.h.
eip::EncapPacket::EncapPacket |
( |
EIP_UINT |
command, |
|
|
EIP_UDINT |
session_handle, |
|
|
shared_ptr< Serializable > |
payload |
|
) |
| |
|
inline |
Construct an encapsulation packet with a data payload
- Parameters
-
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.
Reader & eip::EncapPacket::deserialize |
( |
Reader & |
reader, |
|
|
size_t |
length |
|
) |
| |
Deserialize packet from the given reader with the max length given
- Parameters
-
reader | Reader to use for deserialization |
length | Length expected for the packet |
- Returns
- the reader again
- Exceptions
-
std::length_error | if the buffer is overrun while deserializing |
Definition at line 77 of file encap_packet.cpp.
Reader & eip::EncapPacket::deserialize |
( |
Reader & |
reader | ) |
|
Deserialize data from the given reader without length information
- Parameters
-
reader | Reader to use for deserialization |
- Returns
- the reader again
- Exceptions
-
std::length_error | if the buffer is overrun while deserializing |
Definition at line 61 of file encap_packet.cpp.
Get the header portion of this packet
- Returns
- Header data
Definition at line 78 of file encap_packet.h.
size_t eip::EncapPacket::getLength |
( |
| ) |
const |
|
inline |
Get the length of the entire packet, not just the payload
- Returns
- total length of the header and the payload combined
Definition at line 112 of file encap_packet.h.
shared_ptr<Serializable> eip::EncapPacket::getPayload |
( |
| ) |
const |
|
inline |
Get the data payload from this packet
- Returns
- the data payload of the packet
Definition at line 87 of file encap_packet.h.
void eip::EncapPacket::getPayloadAs |
( |
Serializable & |
result | ) |
|
Get the payload as a particular serializable instance
- Parameters
-
result | Serializable class to get data into |
Definition at line 44 of file encap_packet.cpp.
Writer & eip::EncapPacket::serialize |
( |
Writer & |
writer | ) |
const |
Serialize the packet to the given writer
- Parameters
-
writer | The Writer into which to serialize |
- Returns
- the writer again
Definition at line 49 of file encap_packet.cpp.
void eip::EncapPacket::setPayload |
( |
shared_ptr< Serializable > |
payload | ) |
|
|
inline |
Set the payload for this packet
- Parameters
-
Definition at line 96 of file encap_packet.h.
void eip::EncapPacket::updateLength |
( |
| ) |
|
|
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.
shared_ptr<Serializable> eip::EncapPacket::payload_ |
|
private |
The documentation for this class was generated from the following files: