Safe Haskell | None |
---|---|
Language | Haskell2010 |
- handleMessage :: (MessageHeader -> [SomeDBusValue] -> IO ()) -> (MessageHeader -> [SomeDBusValue] -> IO a) -> TVar AnswerSlots -> TVar SignalSlots -> TVar PropertySlots -> (MessageHeader, [SomeDBusValue]) -> IO ()
- objectRoot :: Objects -> Handler
- checkAlive :: DBusConnection -> IO Bool
- waitFor :: DBusConnection -> IO ()
- data ConnectionType
- type MethodCallHandler = DBusConnection -> MessageHeader -> [SomeDBusValue] -> IO ()
- type SignalHandler = DBusConnection -> MessageHeader -> [SomeDBusValue] -> IO ()
- connectBus :: ConnectionType -> MethodCallHandler -> SignalHandler -> IO DBusConnection
- connectBusWithAuth :: ConnectionType -> SASL ByteString -> MethodCallHandler -> SignalHandler -> IO DBusConnection
- makeServer :: ConnectionType -> Objects -> IO DBusConnection
- makeServerWithAuth :: ConnectionType -> SASL ByteString -> Objects -> IO DBusConnection
- type Handler = DBusConnection -> MessageHeader -> [SomeDBusValue] -> IO ()
- sendCredentials :: Socket -> IO Int
Documentation
handleMessage :: (MessageHeader -> [SomeDBusValue] -> IO ()) -> (MessageHeader -> [SomeDBusValue] -> IO a) -> TVar AnswerSlots -> TVar SignalSlots -> TVar PropertySlots -> (MessageHeader, [SomeDBusValue]) -> IO () Source #
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
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 #
= DBusConnection | Connection that the call was received from. Should be used to return the result or error |
-> MessageHeader | |
-> [SomeDBusValue] | |
-> IO () |
type SignalHandler = DBusConnection -> MessageHeader -> [SomeDBusValue] -> IO () Source #
:: 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.
:: 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 Mesage 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.
type Handler = DBusConnection -> MessageHeader -> [SomeDBusValue] -> IO () Source #