serial.h

来自「linux下modem初始化测试」· C头文件 代码 · 共 24 行

H
24
字号
#ifndef SERIAL_H
#define SERIAL_H

#define ERR_BAUDRATE	-1
#define ERR_DATABIT		-2
#define ERR_STOPBIT		-3
#define ERR_PARITY		-4
#define ERR_FLOWCTL		-5
#define ERR_FLOWCONTROL -6
#define ERR_SETTING		-8
#define ERR_GETOPT		-10
#define ERR_SETOPT		-11

int _comm_open(const char* devname, struct termios* psaveoptions, int baud, int databits, int stopbits, char parity, char flowControl);
int  comm_open(const char* devname, struct termios* psaveoptions, const char* settings);
int  comm_close(int fd, struct termios* saveoptions);
int  comm_write(int fd,char *buf,int len);
int  comm_read(int fd,char *buf,int len,int time);
void delay(int ms);
int gettickcount();

#endif //SERIAL_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?