RelayFile/Protocol/Communicate.h

28 lines
483 B
C
Raw Normal View History

2025-05-05 23:22:43 +08:00
#ifndef COMMUNICATE_H
#define COMMUNICATE_H
2025-05-10 01:25:02 +08:00
#include <Util.h>
#include <cstdint>
2025-05-10 01:25:02 +08:00
struct FrameBuffer {
FrameBuffer();
2025-05-10 01:25:02 +08:00
~FrameBuffer();
uint8_t unpack{};
2025-05-10 01:25:02 +08:00
std::string fid;
std::string tid;
const char* dataConst;
char* dataMut;
2025-05-10 01:25:02 +08:00
int len{};
};
2025-05-05 23:22:43 +08:00
class Communicate
{
public:
Communicate();
2025-05-10 01:25:02 +08:00
public:
static FrameBuffer* ParseBuffer(MutBuffer& buffer);
static bool PackBuffer(FrameBuffer* frame, char** buf, int& len);
2025-05-05 23:22:43 +08:00
};
#endif // COMMUNICATE_H