Remove unused SerialControl::getTty()
[remote/remote-mci.git] / diku_mch / SerialControl.h
blob4c63fd809e75fc58c272f232fb7db716316a613e
1 #ifndef _SERIALCONTROL_H_
2 #define _SERIALCONTROL_H_
4 #include <string>
5 #include <errno.h>
6 #include <termios.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <fcntl.h>
11 #include <sys/signal.h>
12 #include <sys/types.h>
13 #include <sys/wait.h>
14 #include <sys/ioctl.h>
16 #include "libutil/Log.h"
17 #include "types.h"
18 #include "motecontrol/localconstants.h"
20 namespace remote { namespace diku_mch {
22 using namespace protocols;
23 using namespace protocols::motecontrol;
24 using namespace util;
26 class SerialControl
28 public:
29 SerialControl();
30 ~SerialControl();
31 bool runChild(char * const args[], char * const envp[]);
32 result_t getChildResult();
33 result_t cancelProgramming();
34 result_t reset();
35 result_t start();
36 result_t stop();
37 ssize_t readBuf(char *buf, size_t len);
38 ssize_t writeBuf(const char *buf, size_t len);
39 int getFd();
40 status_t getStatus();
41 protected:
42 bool hasChild();
43 bool isOpen();
44 bool openTty();
45 void closeTty();
46 bool endChild(bool killChild);
47 result_t power(const std::string cmd);
48 bool controlDTR(bool enable);
49 int port;
50 bool isRunning;
51 pid_t childPid;
52 std::string tty;
53 struct termios oldsertio;
58 #endif