Next: Low-Level API Reference, Previous: IP Library, Up: guile-netlink [Contents][Index]
This chapter describes the high-level procedures contained in the
(netlink acpi)
module that let you monitor the kernel for ACPI event
notifications. At top level, the requirement is to connect to the kernel’s
netlink system, and then you receive three procedures for handling
notifications on the connection. The first, nominally called
(read-selector)
, provides a file descriptor which you can use in a
select
read-list to wait for a notification to become available on the
connection.
Once you know that data are there waiting to be read, you use the second
provided procedure: (process-data action)
, where the action
you supply must be a procedure which takes in an event
object, and does
whatever the application needs to do. Data can be extracted from this object
with event-device-class
, event-bus-id
, event-kind
and
event-data
.
When all is done, the connection should be closed with a call to the third
provided function: (close-connection)
.