Boost logo

Boost Users :

Subject: Re: [Boost-users] [Asio] Need help making a custom service
From: Bjorn Reese (breese_at_[hidden])
Date: 2015-03-09 16:21:56

On 03/09/2015 06:49 PM, Kyle Edwards wrote:

> Second, I have a question about making a custom service. I would like to
> make a service that triggers a callback when a GPIO pin changes state
> and triggers an interrupt (I'm using a Raspberry Pi.) I have (or can
> obtain) a file descriptor that can be poll()'d, select()'d, or epoll'd
> and which omits high-priority events (POLLPRI, EPOLLPRI, etc.). This

Then you can wrap your file descriptor in a posix::stream_descriptor
[1] and wait on events using async_read_some() with null_buffers() [2].

An example can be found in [3]. The example assumes that the wrapper
does not take ownership of the file descriptor (if it does, then you
can omit the non_closing_service.)


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at