License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell98 |
- establish :: IO DBusContext -> (DBusContext -> IO ()) -> IO DBusConnection
- establishWithCatchall :: (DBusMessage -> IO ()) -> IO DBusContext -> (DBusContext -> IO a) -> IO DBusConnection
- disconnect :: DBusConnection -> IO ()
- data DBusConnection
- class DBusMessageable a where
- 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
- 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 a) -> IO DBusConnection Source #
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 where Source #
toDBusMessage :: a -> DBusMessage Source #
fromDBusMessage :: DBusMessage -> Maybe a Source #
DBusCall | |
|
data DBusReturn Source #
DBusReturn | |
|
data DBusSignal Source #
DBusSignal | |
|
DBus Types
class DBusTypeable a where Source #
toSignature :: a -> Type Source #
toDBusValue :: a -> DBusValue Source #
fromDBusValue :: DBusValue -> Maybe a Source #
newtype ObjectPath Source #
newtype PackedString Source #
One possible signature element
type SignatureElem = Type Source #
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 DBusConnection Source #
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 DBusConnection Source #
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 DBusReturn Source #
call a method on the DBus, and wait synchronously for the return value.
reply :: DBusMessageable a => DBusConnection -> a -> IO Serial Source #
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 a Source #
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
create a new context on system or session bus
busGetSystem :: IO DBusContext Source #
create a new DBus context on system bus
busGetSession :: IO DBusContext Source #
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.