Loading...
Searching...
No Matches
Line status watch events

## Enumerations

enum | gpiod_info_event_type { GPIOD_INFO_EVENT_LINE_REQUESTED = 1 , GPIOD_INFO_EVENT_LINE_RELEASED , GPIOD_INFO_EVENT_LINE_CONFIG_CHANGED }
| Line status change event types. More...

## Functions

void | gpiod_info_event_free (struct gpiod_info_event *event)
| Free the info event object and release all associated resources.
enum gpiod_info_event_type | gpiod_info_event_get_event_type (struct gpiod_info_event *event)
| Get the event type of the status change event.
uint64_t | gpiod_info_event_get_timestamp_ns (struct gpiod_info_event *event)
| Get the timestamp of the event.
struct gpiod_line_info * | gpiod_info_event_get_line_info (struct gpiod_info_event *event)
| Get the snapshot of line-info associated with the event.

## Detailed Description

Accessors for the info event objects allowing to monitor changes in GPIO line status.

Callers are notified about changes in a line's status due to GPIO uAPI calls. Each info event contains information about the event itself (timestamp, type) as well as a snapshot of line's status in the form of a line-info object.

## Enumeration Type Documentation

## gpiod_info_event_type

enum gpiod_info_event_type

Line status change event types.

Enumerator
GPIOD_INFO_EVENT_LINE_REQUESTED | Line has been requested.
GPIOD_INFO_EVENT_LINE_RELEASED | Previously requested line has been released.
GPIOD_INFO_EVENT_LINE_CONFIG_CHANGED | Line configuration has changed.

## Function Documentation

## gpiod_info_event_free()

void gpiod_info_event_free | ( | struct gpiod_info_event * | event | ) |

Free the info event object and release all associated resources.

Parameters

  event | Info event to free.

## gpiod_info_event_get_event_type()

enum gpiod_info_event_type gpiod_info_event_get_event_type | ( | struct gpiod_info_event * | event | ) |

Get the event type of the status change event.

Parameters

  event | Line status watch event.

Returns
  One of GPIOD_INFO_EVENT_LINE_REQUESTED, GPIOD_INFO_EVENT_LINE_RELEASED or GPIOD_INFO_EVENT_LINE_CONFIG_CHANGED.

## gpiod_info_event_get_line_info()

struct gpiod_line_info * gpiod_info_event_get_line_info | ( | struct gpiod_info_event * | event | ) |

Get the snapshot of line-info associated with the event.

Parameters

  event | Line info event object.

Returns
  Returns a pointer to the line-info object associated with the event. The object lifetime is tied to the event object, so the pointer must be not be freed by the caller.

Warning
  Thread-safety: Since the line-info object is tied to the event, different threads may not operate on the event and line-info at the same time. The line-info can be copied using gpiod_line_info_copy in order to create a standalone object - which then may safely be used from a different thread concurrently.

## gpiod_info_event_get_timestamp_ns()

uint64_t gpiod_info_event_get_timestamp_ns | ( | struct gpiod_info_event * | event | ) |

Get the timestamp of the event.

Parameters

  event | Line status watch event.

Returns
  Timestamp in nanoseconds, read from the monotonic clock.