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>
|
2025-05-10 14:48:42 +08:00
|
|
|
#include <cstdint>
|
2025-05-10 01:25:02 +08:00
|
|
|
|
|
|
|
struct FrameBuffer {
|
2025-05-10 14:48:42 +08:00
|
|
|
FrameBuffer();
|
2025-05-10 01:25:02 +08:00
|
|
|
~FrameBuffer();
|
2025-05-10 14:48:42 +08:00
|
|
|
uint8_t unpack{};
|
2025-05-10 01:25:02 +08:00
|
|
|
std::string fid;
|
|
|
|
std::string tid;
|
2025-05-10 14:48:42 +08:00
|
|
|
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
|