Portability | unknown |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
- establish :: IO DBusContext -> (DBusContext -> IO ()) -> IO DBusConnection
- establishWithCatchall :: (DBusMessage -> IO ()) -> IO DBusContext -> (DBusContext -> IO t) -> IO DBusConnection
- disconnect :: DBusConnection -> IO ()
- data DBusConnection
- class DBusMessageable a where
- toDBusMessage :: a -> DBusMessage
- fromDBusMessage :: DBusMessage -> Maybe a
- data DBusCall = DBusCall {
- callPath :: ObjectPath
- callMember :: Member
- callInterface :: Maybe Interface
- callBody :: Body
- data DBusReturn = DBusReturn {
- returnReplySerial :: Serial
- returnBody :: Body
- data DBusError = DBusError {
- errorReplySerial :: Serial
- errorName :: ErrorName
- errorBody :: Body
- data DBusSignal = DBusSignal {
- signalPath :: ObjectPath
- signalMember :: Member
- signalInterface :: Interface
- signalBody :: Body
- data DBusValue
- = DBusByte Word8
- | DBusBoolean Bool
- | DBusInt16 Int16
- | DBusUInt16 Word16
- | DBusInt32 Int32
- | DBusUInt32 Word32
- | DBusInt64 Int64
- | DBusUInt64 Word64
- | DBusDouble Double
- | DBusString PackedString
- | DBusObjectPath ObjectPath
- | DBusSignature Signature
- | DBusByteArray ByteString
- | DBusArray Type [DBusValue]
- | DBusStruct Signature [DBusValue]
- | DBusDict DBusValue DBusValue
- | DBusVariant DBusValue
- | DBusUnixFD Word32
- class DBusTypeable a where
- toSignature :: a -> Type
- toDBusValue :: a -> DBusValue
- fromDBusValue :: DBusValue -> Maybe a
- newtype ObjectPath = ObjectPath {}
- newtype PackedString = PackedString {}
- packedStringToString :: PackedString -> String
- data Type
- type Signature = [Type]
- type SignatureElem = Type
- data DBusMatchRules = DBusMatchRules {}
- defaultDBusMatchRules :: DBusMatchRules
- data MessageType
- newtype BusName = BusName {}
- newtype ErrorName = ErrorName {}
- newtype Member = Member {}
- newtype Interface = Interface {}
- addMatch :: DBusConnection -> DBusMatchRules -> IO ()
- runMainLoop :: DBusContext -> IO DBusConnection
- runMainLoopCatchall :: (DBusMessage -> IO ()) -> DBusContext -> IO DBusConnection
- call :: DBusConnection -> BusName -> DBusCall -> IO DBusReturn
- reply :: DBusMessageable a => DBusConnection -> a -> IO Serial
- calltableFromList :: [(Member, Interface, a)] -> DispatchTable a
- registerPath :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()
- unregisterPath :: DBusConnection -> ObjectPath -> IO ()
- registerCall :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()
- unregisterCall :: DBusConnection -> ObjectPath -> IO ()
- registerSignal :: DBusConnection -> ObjectPath -> DispatchTable Signalback -> IO ()
- unregisterSignal :: DBusConnection -> ObjectPath -> IO ()
- type Signalback = BusName -> Signature -> Body -> IO ()
- type Callback = Serial -> Signature -> Body -> IO ()
- type DispatchTable a = Map Member [(Interface, a)]
- busGetSystem :: IO DBusContext
- busGetSession :: IO DBusContext
- authenticate :: DBusContext -> ByteString -> IO ()
- authenticateUID :: DBusContext -> Int -> IO ()
- authenticateWithRealUID :: DBusContext -> IO ()
handle connections to DBus
:: IO DBusContext | function to create a new dbus context (busGetSystem or busGetSession) |
-> (DBusContext -> IO ()) | function to authenticate to dbus |
-> IO DBusConnection |
Establish a new connection to dbus, using the two functions to first establish a new context, and second to authenticate to the bus. this will automatically create a mainloop thread.
establishWithCatchall :: (DBusMessage -> IO ()) -> IO DBusContext -> (DBusContext -> IO t) -> IO DBusConnectionSource
disconnect :: DBusConnection -> IO ()Source
Close dbus socket and stop mainloop thread.
data DBusConnection Source
opaque type representing a connection to DBus and a receiving dispatcher thread. maintain table to route message between handlers.
Types
class DBusMessageable a whereSource
toDBusMessage :: a -> DBusMessageSource
fromDBusMessage :: DBusMessage -> Maybe aSource
DBusCall | |
|
data DBusReturn Source
DBusReturn | |
|
data DBusSignal Source
DBusSignal | |
|
DBus Types
class DBusTypeable a whereSource
toSignature :: a -> TypeSource
toDBusValue :: a -> DBusValueSource
fromDBusValue :: DBusValue -> Maybe aSource
newtype ObjectPath Source
newtype PackedString Source
One possible signature element
type SignatureElem = TypeSource
Deprecated: use Type instead
data DBusMatchRules Source
data MessageType Source
dbus message types
standard way to interact with dbus
addMatch :: DBusConnection -> DBusMatchRules -> IO ()Source
Add a match rules which will cause to receive message that aren't directed to this connection but match this rule.
main loop creation
runMainLoop :: DBusContext -> IO DBusConnectionSource
run a main DBus loop which will create a new dispatcher handshake on the bus and wait for message to dispatch
runMainLoopCatchall :: (DBusMessage -> IO ()) -> DBusContext -> IO DBusConnectionSource
similar to runMainLoop
but also give the ability to specify
a catch-all-message callback for any message that are not handled
by specific function.
interact with the connection
call :: DBusConnection -> BusName -> DBusCall -> IO DBusReturnSource
call a method on the DBus, and wait synchronously for the return value.
reply :: DBusMessageable a => DBusConnection -> a -> IO SerialSource
Send an arbitrary DBusMessageable message on the bus, using a new serial value. the serial value allocated is returned to the caller.
PS: completely misnamed.
calltableFromList :: [(Member, Interface, a)] -> DispatchTable aSource
registerPath :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()Source
Deprecated: use registerCall
unregisterPath :: DBusConnection -> ObjectPath -> IO ()Source
Deprecated: use unregisterCall
registerCall :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()Source
Register a method handler table for a specific object path
unregisterCall :: DBusConnection -> ObjectPath -> IO ()Source
Unregister all method handlers for a specific object path
registerSignal :: DBusConnection -> ObjectPath -> DispatchTable Signalback -> IO ()Source
Register a signal handler table for a specific object path
unregisterSignal :: DBusConnection -> ObjectPath -> IO ()Source
Unregister all signals handler for a specific object path
Types to interact with the dispatcher
type Signalback = BusName -> Signature -> Body -> IO ()Source
type DispatchTable a = Map Member [(Interface, a)]Source
create a new context on system or session bus
busGetSystem :: IO DBusContextSource
create a new DBus context on system bus
busGetSession :: IO DBusContextSource
create a new DBus context on session bus
authenticate methods available
authenticate :: DBusContext -> ByteString -> IO ()Source
authenticate to DBus using a raw bytestring.
authenticateUID :: DBusContext -> Int -> IO ()Source
authenticate to DBus using a UID.
authenticateWithRealUID :: DBusContext -> IO ()Source
use the real user UID to authenticate to DBus.