39 auto socket = std::make_unique<TCPSocket>();
40 if (!socket->connect(host.c_str(), port)) {
47 return new rclip(std::move(socket));
72 if (
socket_->getBufferStore(
a) == 1) {
73 if (!strcmp(
a.getString(0),
"NAK")) {
76 if (!strcmp(
a.getString(0),
"Ok")) {
113 result =
socket_->sendBufferStore(
a);
116 result =
socket_->sendBufferStore(
a);
135 int r =
socket_->getBufferStore(
a,
false);
142 if ((
a.getLen() != 1) || (
a.getByte(0) != 0)) {
156 if ((
a.getLen() != 1) || (
a.getByte(0) != 0)) {
186 if ((
a.getLen() != 3) || (
a.getByte(0) !=
RCLIP_INIT) || (
a.getWord(1) != 0x100)) {
200 if (
socket_->getBufferStore(data) == 1) {
A generic container for an array of bytes.
Wrapper class featuring range-checking and string representation of enumerated values.
Remote ClipBoard services via PLP.
Enum< RFSV::errs > sendListen()
Send listen request.
Enum< RFSV::errs > status
The current status of the connection.
Enum< RFSV::errs > checkNotify()
Check for clipboard notification.
Enum< RFSV::errs > getStatus()
Retrieves the current status of the connection.
rclip(std::unique_ptr< TCPSocket > socket)
Constructs a new rclip object.
Enum< RFSV::errs > waitNotify()
Send listen request and wait for notification.
bool sendCommand(enum commands cc)
Sends a command to the remote side.
const char * getConnectName()
Enum< RFSV::errs > getResponse(BufferStore &data)
void reconnect()
Attempts to re-establish a remote connection by first closing the socket, then connecting again to th...
Enum< RFSV::errs > initClipbd()
Send initialization frame.
commands
The possible commands.
static rclip * connect(const std::string &host, int port, Enum< ConnectionError > *error=nullptr)
Enum< RFSV::errs > notify()
Send a notification to the Psion.
void reset()
Initializes a connection to the remote machine.
std::unique_ptr< TCPSocket > socket_
The socket, used for communication with ncpd.
@ FACERR_CONNECTION_FAILURE
static void error(int line)