* new Packet::writeTo(), readFrom() methods. (for saving snapshots of packets)
This commit is contained in:
14
src/Packet.h
14
src/Packet.h
@@ -71,6 +71,20 @@ public:
|
||||
|
||||
void markDoNotRetransmit() { header = 0xFF; }
|
||||
bool isMarkedDoNotRetransmit() const { return header == 0xFF; }
|
||||
|
||||
/**
|
||||
* \brief save entire packet as a blob
|
||||
* \param dest (OUT) destination buffer (assumed to be MAX_MTU_SIZE)
|
||||
* \returns the packet length
|
||||
*/
|
||||
uint8_t writeTo(uint8_t dest[]) const;
|
||||
|
||||
/**
|
||||
* \brief restore this packet from a blob (as created using writeTo())
|
||||
* \param src (IN) buffer containing blob
|
||||
* \param len the packet length (as returned by writeTo())
|
||||
*/
|
||||
bool readFrom(const uint8_t src[], uint8_t len);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user