-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathautotty.h
51 lines (38 loc) · 901 Bytes
/
autotty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* autotty.h
*
* (C) Copyright 2014 Ulrich Hecht
*
* This file is part of CASCADE. CASCADE is almost free software; you can
* redistribute it and/or modify it under the terms of the Cascade Public
* License 1.0. Read the file "LICENSE" for details.
*/
#include <stdint.h>
class UI;
class AutoTTY {
public:
AutoTTY(UI *ui, const char *driver);
~AutoTTY();
void setBaudrate(int baudrate);
void clearBreak();
void clearDTR();
void clearRTS();
void setBreak();
void setDTR();
void setRTS();
int readToBuffer(void *buf, int count);
void sendByte(char byte);
void sendBuf(uint8_t *buf, int len);
void flush();
void assertInterface();
private:
void down(const char *reason = 0);
void searchTTY();
bool plugged_in;
int saved_baudrate;
bool saved_break, saved_dtr, saved_rts;
bool shown_iface_warning;
UI *ui;
char *driver;
int sh;
};