d-bus-0.1.8: Permissively licensed D-Bus client library

Safe HaskellNone
LanguageHaskell2010

DBus.MainLoop

Synopsis

Documentation

objectRoot :: Objects -> Handler Source #

Create a message handler that dispatches matches to the methods in a root object

checkAlive :: DBusConnection -> IO Bool Source #

Check whether connection is alive

waitFor :: DBusConnection -> IO () Source #

Wait until connection is closed. The intended use is to keep alive servers

data ConnectionType Source #

Which Bus to connect to

Constructors

System

The well-known system bus. First the environmental variable DBUS_SYSTEM_BUS_ADDRESS is checked and if it doesn't exist the address unix:path=/var/run/dbus/system_bus_socket is used

Session

The well-known session bus. Refers to the address stored in the environmental variable DBUS_SESSION_BUS_ADDRESS

Address String

The bus at the give addresss

type MethodCallHandler Source #

Arguments

 = DBusConnection

Connection that the call was received from. Should be used to return the result or error

-> MessageHeader 
-> [SomeDBusValue] 
-> IO () 

connectBus Source #

Arguments

:: ConnectionType

Bus to connect to

-> MethodCallHandler

Handler for incoming method calls

-> SignalHandler

Handler for incoming signals

-> IO DBusConnection 

General way to connect to a message bus, see connectBusWithAuth.

Uses the EXTERNAL authentication mechanism.

connectBusWithAuth Source #

Arguments

:: ConnectionType

Bus to connect to

-> SASL ByteString

The authentication mechanism

-> MethodCallHandler

Handler for incoming method calls

-> SignalHandler

Handler for incoming signals

-> IO DBusConnection 

General way to connect to a message bus, with a custom authentication method. Takes two callback functions:

  • A MethodCallHandler that is invoked when a method call is received.
  • A SignalHandler that is invoked when a Signak is received:

makeServer :: ConnectionType -> Objects -> IO DBusConnection Source #

Create a simple server that exports Objects and ignores all incoming signals.

Use the default EXTERNAL authentication mechanism (see makeServerWithAuth).

makeServerWithAuth :: ConnectionType -> SASL ByteString -> Objects -> IO DBusConnection Source #

Create a simple server with a custom bus authentication mechanism that exports Objects and ignores all incoming signals.

close :: DBusConnection -> IO () Source #

Close the connection and finalize all handlers.

This is automatically done when the connection is garbage collected, but