Loading...
Searching...
No Matches
async_read.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for
6 * more details.
7 */
8
18#ifndef ASYNC_READ_H
19#define ASYNC_READ_H
20
21#include <stdlib.h>
22#include <poll.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31#ifndef ASYNC_READ_NUMOF
32#define ASYNC_READ_NUMOF 2
33#endif
34
38typedef void (*native_async_read_callback_t)(int fd, void *arg);
39
43typedef struct {
44 pid_t child_pid;
46 void *arg;
47 struct pollfd *fd;
49
56
63
72
82
89
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* ASYNC_READ_H */
void native_async_read_add_handler(int fd, void *arg, native_async_read_callback_t handler)
start monitoring of file descriptor
void native_async_read_cleanup(void)
shutdown asynchronous read system
void native_async_read_add_int_handler(int fd, void *arg, native_async_read_callback_t handler)
start monitoring of file descriptor as interrupt
void native_async_read_remove_handler(int fd)
stop monitoring of file descriptor
void(* native_async_read_callback_t)(int fd, void *arg)
asynchronous read callback type
Definition async_read.h:38
void native_async_read_setup(void)
initialize asynchronous read system
void native_async_read_continue(int fd)
resume monitoring of file descriptors
Interrupt callback information structure.
Definition async_read.h:43
void * arg
Argument ptr for the callback.
Definition async_read.h:46
pid_t child_pid
PID of the interrupt listener.
Definition async_read.h:44
native_async_read_callback_t cb
Interrupt callback function.
Definition async_read.h:45
struct pollfd * fd
sysfs gpio fd
Definition async_read.h:47