mirror of
https://github.com/eddyem/tty_term.git
synced 2026-06-21 19:36:29 +03:00
update for libusefull_macros v.0.3.2
This commit is contained in:
17
ttysocket.h
17
ttysocket.h
@@ -24,7 +24,7 @@
|
||||
#include <asm-generic/termbits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
//#include "dbg.h"
|
||||
#include <usefull_macros.h>
|
||||
|
||||
typedef enum{ // device: tty terminal, network socket or UNIX socket
|
||||
DEV_TTY,
|
||||
@@ -32,27 +32,16 @@ typedef enum{ // device: tty terminal, network socket or UNIX socket
|
||||
DEV_UNIXSOCKET,
|
||||
} devtype;
|
||||
|
||||
typedef struct {
|
||||
char *portname; // device filename (should be freed before structure freeing)
|
||||
int speed; // baudrate in human-readable format
|
||||
char *format; // format like 8N1
|
||||
struct termios2 oldtty; // TTY flags for previous port settings
|
||||
struct termios2 tty; // TTY flags for current settings
|
||||
int comfd; // TTY file descriptor
|
||||
uint8_t *buf; // buffer for data read
|
||||
size_t bufsz; // size of buf
|
||||
size_t buflen; // length of data read into buf
|
||||
} TTY_descr2;
|
||||
|
||||
typedef struct{
|
||||
devtype type; // type
|
||||
char *name; // filename (dev or UNIX socket) or server name/IP
|
||||
TTY_descr2 *dev; // tty serial device
|
||||
sl_tty_t *dev; // tty serial device
|
||||
char *port; // port to connect
|
||||
int speed; // tty speed
|
||||
pthread_mutex_t mutex; // reading/writing mutex
|
||||
char eol[3]; // end of line
|
||||
char seol[5]; // `eol` with doubled backslash (for print @ screen)
|
||||
int exclusive;
|
||||
} chardevice;
|
||||
|
||||
uint8_t *ReadData(int *l);
|
||||
|
||||
Reference in New Issue
Block a user