forked from ec429/3psk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathptt.h
42 lines (36 loc) · 721 Bytes
/
ptt.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
/*
3psk - 3-pole Phase Shift Keying
Copyright (c) Edward Cree, 2013
Licensed under the GNU GPL v3+
ptt: Push To Talk control
*/
#include <stdbool.h>
#ifdef WINDOWS
/* dummy only, PTT not supported */
enum ptt_line
{
PTT_LINE_NONE = 0,
PTT_LINE_RTS,
PTT_LINE_DTR,
PTT_LINE_BOTH,
};
#else /* !WINDOWS */
#include <sys/ioctl.h>
enum ptt_line
{
PTT_LINE_NONE = 0,
PTT_LINE_RTS = TIOCM_RTS,
PTT_LINE_DTR = TIOCM_DTR,
PTT_LINE_BOTH = TIOCM_RTS | TIOCM_DTR,
};
#endif /* !WINDOWS */
struct ptt_settings
{
char *devpath;
int devfd;
bool inverted;
enum ptt_line line;
};
int ptt_open(struct ptt_settings *set);
int ptt_set(bool tx, const struct ptt_settings *set);
int ptt_close(struct ptt_settings *set);