mirror of
http://180.163.74.83:13000/zhangzhenghao/AP05.git
synced 2025-12-12 15:04:29 +00:00
28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
#ifndef __READ_UTILS_H__
|
|
#define __READ_UTILS_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*************************************************************
|
|
* 功能: 设定的时间内读取数据
|
|
**************************************************************/
|
|
int read_data_until_time(int fd, char *buffer, int len, int timeout_first, int timeout_interval);
|
|
|
|
/*************************************************************
|
|
* 功能: 读一串至截止字符的字符串,在设定的时间内读不到数据则函数返回
|
|
**************************************************************/
|
|
int read_data_until_char(int fd, char *buffer, int len, char until, int timeout_first, int timeout_interval);
|
|
|
|
/*************************************************************
|
|
* 功能: 读一串至截止字符串的字符串,在设定的时间内读不到数据则函数返回
|
|
**************************************************************/
|
|
int read_data_until_str(int fd, char *buffer, int len, char *until, int until_len, int timeout_first, int timeout_interval);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|