28 lines
522 B
C++
28 lines
522 B
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
|
|
|
|
namespace drp::packet::base {
|
|
|
|
|
|
// the maximum data length
|
|
// a packet can't be larger than 65565 (uint16 max)
|
|
// reserve some space for metadata and settings
|
|
constexpr std::uint16_t dataLength = 65504;
|
|
|
|
|
|
/**
|
|
* The content of a generic packet.
|
|
* @param eventType the type of event that the packet want to trigger.
|
|
* @param data the data of the event.
|
|
*/
|
|
class PacketContent {
|
|
public:
|
|
std::uint8_t eventType;
|
|
std::array<std::uint8_t, dataLength> data;
|
|
};
|
|
|
|
|
|
}
|