On Sun, Mar 27, 2022 at 2:22 PM Kent Gibson <warthog618@xxxxxxxxx> wrote: > [snip] > > > + ::gpiod::edge_event_buffer buffer; > > > > for (;;) { > > - auto events = lines.event_wait(::std::chrono::seconds(1)); > > - if (events) { > > - for (auto& it: events) > > - print_event(it.event_read()); > > + if (request.wait_edge_event(::std::chrono::seconds(5))) { > > + request.read_edge_event(buffer); > > + > > + for (const auto& event: buffer) > > + print_event(event); > > } > > } > > > > What is the purpose of the wait_edge_event() here? > Wouldn't read_edge_event() block until the next event? > > This example should be minimal and demonstrate how the code should > normally be used. e.g. > > for (const auto& event: request.events_iter()) > print_event(event); > We're making the request's file descriptor non-blocking in the C library. Do you think we should keep it in blocking mode? I'm no longer sure why I did that honestly. Maybe a request config flag for that? Bart