28 lines
502 B
C++
28 lines
502 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <cstdint>
|
|
|
|
#include "protocol.hpp"
|
|
|
|
namespace calrt
|
|
{
|
|
class Client
|
|
{
|
|
public:
|
|
Client(int deviceId): mDevId(deviceId),
|
|
mSocketFd(-1), mMemFd(-1) {}
|
|
~Client();
|
|
int Connect();
|
|
void* MapSharedMem();
|
|
int SendReq(uint64_t address, uint64_t size, uint8_t direction);
|
|
int ReceiveResp();
|
|
|
|
private:
|
|
int mDevId;
|
|
int mSocketFd;
|
|
int mMemFd;
|
|
void *pmMapMem;
|
|
};
|
|
|
|
} |