Enabled arcs render after adapting OpenCNCPilot code.

Started porting iosender to C++
This commit is contained in:
2023-05-16 09:18:06 +03:00
parent c05a6a1ad2
commit 42aefe8ed8
23 changed files with 2200 additions and 18 deletions
+46
View File
@@ -0,0 +1,46 @@
#pragma once
#include <thread>
#include "comms.h"
namespace iosender {
class TelnetStream : public StreamComms {
public:
TelnetStream(std::string host, DataReceivedHandler* dataHandler = nullptr, ByteReceivedHandler *byteHandler = nullptr);
~TelnetStream() override;
bool IsOpen() override;
int OutCount() override;
std::string Reply() override;
Comms::StreamType StreamType() override;
bool EventMode() override;
void EventMode(bool mode) override;
void Close() override;
int ReadByte() override;
void WriteByte(uint8_t data) override;
void WriteBytes(uint8_t *bytes, int len) override;
void WriteString(std::string data) override;
void WriteCommand(std::string command) override;
std::string GetReply(std::string command) override;
void AwaitAck() override;
void AwaitAck(std::string command) override;
void AwaitResponse(std::string command) override;
void AwaitResponse() override;
void PurgeQueue() override;
private:
volatile bool shouldQuit = false;
void readWorker();
std::string reply;
int fd;
bool isConnected;
bool eventMode = true;
std::thread workerThread;
};
}