Apologies for the confusion; I was writing from memory.
A good set of libgpiod
examples is available here.
In your case, you could create a thread with a callback function to wait for an event using gpiod_line_event_wait_bulk()
, then read the lines value. Afterward, you can invoke the callback function, providing the line state. (I noticed that @Edward already suggested this solution to you a few years ago)
Or you can use 6 separate gpiod_ctxless_event_monitor().