📄 serial.h~
字号:
#ifndef __SERIAL_H_#define __SERIAL_H_#include <stdio.h>#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <fcntl.h> #include <termios.h> #include <errno.h> #include <pthread.h>typedef struct tty_info_t{ int fd; pthread_mutex_t mt; char name[24]; struct termios ntm; struct termios otm; } TTY_INFO;class Serial{ public: Serial( ); ~Serial( ); bool readyTTY(int fd); int cleanTTY(); int setTTYSpeed(int speed); int setTTYParity(int databits,int parity,int stopbits); int recvnTTY(char *pbuf,int size); int sendnTTY(char *pbuf,int size); int unlockTTY(TTY_INFO *ptty); int lockTTY(); private: TTY_INFO pttyInfo; TTY_INFO *ptty;};#endif //__SERIAL_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -