add pty-gpib-emulator from github

This commit is contained in:
2020-09-09 05:17:31 +00:00
parent 63554da593
commit 3fe71a6f3b
22 changed files with 997 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#ifndef MIDDLEMAN
#define MIDDLEMAN
#include <string>
class MiddleMan;
using namespace std;
class MiddleMan {
private:
string ttyname;
int mPTY, sPTY;
int mTTY, sTTY;
string ptyname;
bool running;
int sleep; // Microseconds
FILE *fout;
public:
MiddleMan(const string iotty_name,
const string fout_name="out",
int sleepTime=200);
~MiddleMan();
void run(int readLen=100);
string getPTY();
void handleInput(string input);
void log(string input, string output,
const string format=">> %s\n<< %s\n");
string openPTY();
void closePTY();
};
#endif