25 #ifndef NRG_PACKET_HEADER_H
26 #define NRG_PACKET_HEADER_H
46 , frag_index(frag_index){
56 version = ver_idx >> 7;
57 frag_index = ver_idx & 0x1F;
66 p.
write8((version << 7) | (frag_index & 0x1F));
73 uint32_t version, frag_index;
75 static const size_t size = 4;
size_t remaining() const
Get the amount of data that can be read from the internal pointer's current position.
Definition: nrg_packet.h:134
Class for storing data to be sent / received across the network.
Definition: nrg_packet.h:58
PacketWritable & write16(const uint16_t &v)
Write a uint16_t, automatically converting endianness.
PacketWritable & write8(const uint8_t &v)
Write a uint8_t, automatically converting endianness.
virtual PacketReadable & read8(uint8_t &v)=0
Read a uint8_t, automatically converting endianness.
virtual PacketReadable & read16(uint16_t &v)=0
Read a uint16_t, automatically converting endianness.
PacketReadable & read8(uint8_t &v)
Read a uint8_t, automatically converting endianness.