Skip to content

Commit adff575

Browse files
committed
include:ioctl: Add command to peek data from uart buffer
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 329b68c commit adff575

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

include/sys/ioctl.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@
3434
*/
3535
#define FIOASYNC 0x5452
3636

37+
/**
38+
* Get Next character in read buffer
39+
* without removing it. Multiple call to
40+
* ioctl will result in same character unless
41+
* read() is called
42+
* expects int *
43+
*/
44+
#define TIOCPEEK 0x545C
45+
/**
46+
* Get data from read buffer without removing it.
47+
* expects struct @ref iopeek_t *
48+
*/
49+
#define TIOCPEEKBUF 0x545D
50+
51+
/**
52+
* Peek structure
53+
*/
54+
struct iopeek_t {
55+
void *buf; /** Buffer pointer to store read data */
56+
int len; /** Length of buffer, on return this is updated with actual bytes read */
57+
};
58+
3759
#ifdef __cplusplus
3860
extern "C" {
3961
#endif

0 commit comments

Comments
 (0)