udev-0.1.1.0: libudev bindings
Copyright(c) Sam Truzjan 2013
LicenseBSD3
Maintainerpxqr.sta@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

System.UDev.Monitor

Description

Connects to a device event source.

Synopsis

Documentation

data Monitor Source #

Opaque object handling an event source.

Instances

Instances details
UDevChild Monitor Source # 
Instance details

Defined in System.UDev.Monitor

Methods

getUDev :: Monitor -> UDev Source #

Creation

data SourceId Source #

Event source identifier.

Constructors

KernelId

Events are sent out just after kernel processes them.

Applications should usually not connect directly to the "kernel" events, because the devices might not be useable at that time, before udev has configured them, and created device nodes. Use UDevId instead.

UDevId

Events are sent out after udev has finished its event processing, all rules have been processed, and needed device nodes are created.

OtherId ByteString

For extensibility.

Instances

Instances details
Eq SourceId Source # 
Instance details

Defined in System.UDev.Monitor

Ord SourceId Source # 
Instance details

Defined in System.UDev.Monitor

Read SourceId Source # 
Instance details

Defined in System.UDev.Monitor

Show SourceId Source # 
Instance details

Defined in System.UDev.Monitor

newFromNetlink :: UDev -> SourceId -> IO Monitor Source #

Create new udev monitor and connect to a specified event source.

Receiving

enableReceiving :: Monitor -> IO () Source #

Binds the Monitor socket to the event source.

setReceiveBufferSize :: Monitor -> Int -> IO () Source #

Set the size of the kernel socket buffer.

getFd :: Monitor -> IO Fd Source #

Retrieve the socket file descriptor associated with the monitor.

getHandle :: Monitor -> IO Handle Source #

Similar to getFd but retrieves the socket handle associated with the monitor.

receiveDevice :: Monitor -> IO Device Source #

Receive data from the udev monitor socket, allocate a new udev device, fill in the received data, and return the device.

Filter

filterAddMatchSubsystemDevtype :: Monitor -> ByteString -> Maybe ByteString -> IO () Source #

Filter events by subsystem and device type.

The filter must be installed before the monitor is switched to listening mode.

filterAddMatchTag :: Monitor -> ByteString -> IO () Source #

The filter must be installed before the monitor is switched to listening mode.

filterUpdate :: Monitor -> IO () Source #

Update the installed socket filter. This is only needed, if the filter was removed or changed.

filterRemove :: Monitor -> IO () Source #

Remove all filters from monitor.