Portability | portable |
---|---|
Stability | experimental |
Maintainer | pxqr.sta@gmail.com |
Safe Haskell | None |
Connects to a device event source.
- data Monitor
- data SourceId
- udevId :: SourceId
- kernelId :: SourceId
- newFromNetlink :: UDev -> SourceId -> IO Monitor
- enableReceiving :: Monitor -> IO ()
- setReceiveBufferSize :: Monitor -> Int -> IO ()
- getFd :: Monitor -> IO Fd
- getHandle :: Monitor -> IO Handle
- receiveDevice :: Monitor -> IO Device
- filterAddMatchSubsystemDevtype :: Monitor -> BS.ByteString -> BS.ByteString -> IO ()
- filterAddMatchTag :: Monitor -> BS.ByteString -> IO ()
- filterUpdate :: Monitor -> IO ()
- filterRemove :: Monitor -> IO ()
Documentation
Creation
Events are sent out after udev has finished its event processing, all rules have been processed, and needed device nodes are created.
newFromNetlink :: UDev -> SourceId -> IO MonitorSource
Create new udev monitor and connect to a specified event source.
Receiving
enableReceiving :: Monitor -> IO ()Source
Binds the udev_monitor socket to the event source.
setReceiveBufferSize :: Monitor -> Int -> IO ()Source
Set the size of the kernel socket buffer.
receiveDevice :: Monitor -> IO DeviceSource
Receive data from the udev monitor socket, allocate a new udev device, fill in the received data, and return the device.
Filter
filterAddMatchSubsystemDevtype :: Monitor -> BS.ByteString -> BS.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 -> BS.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.