@brief Wait for events on multiple GPIO lines. @param device Name, path, number or label of the gpiochip. @param event_type Type of events to listen for. @param offsets Array of GPIO line offsets to monitor. @param num_lines Number of lines to monitor. @param active_low The active state of this line - true if low. @param consumer Name of the consumer. @param timeout Maximum wait time for each iteration. @param poll_cb Callback function to call when waiting for events. Can be NULL. @param event_cb Callback function to call on event occurrence. @param data User data passed to the callback. @param flags The flags for the lines. @return 0 no errors were encountered, -1 if an error occurred. @note The poll callback can be NULL in which case the routine will fall back to a basic, ppoll() based callback.
Internally this routine opens the GPIO chip, requests the set of lines for the type of events specified in the event_type parameter and calls the polling callback in a loop. The role of the polling callback is to detect input events on a set of file descriptors and notify the caller about the fds ready for reading.
The ctxless event loop then reads each queued event from marked descriptors and calls the event callback. Both callbacks can stop the loop at any point.
The poll_cb argument can be NULL in which case the function falls back to a default, ppoll() based callback.