acadia/lib/mammoth/ipc/port_server.h
Drew Galbraith 1b7d2b9085 [Teton/Voyageurs] Subscribe to scancodes in teton and print them to screen.
Right now there appears to be an error with the font so that the
proper character is received but we write an incorect character to the
screen (off by one?).
2023-11-25 19:48:06 -08:00

31 lines
604 B
C++

#pragma once
#include <glacier/status/error_or.h>
#include <ztypes.h>
#include "mammoth/ipc/port_client.h"
namespace mmth {
class PortServer {
public:
PortServer() {}
static glcr::ErrorOr<PortServer> Create();
static PortServer AdoptCap(z_cap_t cap);
glcr::ErrorOr<PortClient> CreateClient();
glcr::ErrorCode RecvCap(uint64_t* num_bytes, char* msg, uint64_t* cap);
glcr::ErrorCode PollForIntCap(uint64_t* msg, uint64_t* cap);
glcr::ErrorOr<char> RecvChar();
z_cap_t cap() { return port_cap_; }
private:
z_cap_t port_cap_;
PortServer(z_cap_t cap);
};
} // namespace mmth