-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Small DBus implementation -- -- Small and flexible implementation of the dbus protocol. @package udbus @version 0.1 module Network.DBus -- | Represent an open access to dbus. for now only based on system handle. data DBusHandle authenticate :: ByteString -> DBusContext () authenticateUID :: Int -> DBusContext () -- | connect to the dbus session bus define by the environment variable -- DBUS_SESSION_BUS_ADDRESS connectSession :: IO DBusHandle -- | connect to the dbus system bus connectSystem :: IO DBusHandle -- | connect onto a previously open handle connectHandle :: Handle -> IO DBusHandle -- | create a new Dbus context from a ini function to create a dbusHandle. withContext :: IO DBusHandle -> DBusContext a -> IO a -- | create a new Dbus context on session bus withSession :: DBusContext a -> IO a -- | create a new Dbus context on system bus withSystem :: DBusContext a -> IO a -- | send one message to the bus note that the serial of the message sent -- is allocated here. messageSend :: Message -> DBusContext Serial -- | receive one single message from the bus it is not necessarily the -- reply from a previous sent message. messageRecv :: DBusContext Message -- | dbus message types data MessageType TypeInvalid :: MessageType TypeMethodCall :: MessageType TypeMethodReturn :: MessageType TypeError :: MessageType TypeSignal :: MessageType -- | dbus message flags data MessageFlag FlagNoReplyExpected :: MessageFlag FlagNoAutoStart :: MessageFlag data Field FieldPath :: ObjectPath -> Field FieldInterface :: Interface -> Field FieldMember :: Member -> Field FieldErrorName :: ErrorName -> Field FieldReplySerial :: Serial -> Field FieldDestination :: BusName -> Field FieldSender :: ByteString -> Field FieldSignature :: Signature -> Field FieldUnixFds :: Word32 -> Field data Message Message :: DbusEndian -> !MessageType -> !Int -> !Int -> !Serial -> [Field] -> ByteString -> Message msgEndian :: Message -> DbusEndian msgType :: Message -> !MessageType msgVersion :: Message -> !Int msgFlags :: Message -> !Int msgSerial :: Message -> !Serial msgFields :: Message -> [Field] msgBody :: Message -> ByteString -- | dbus serial number type Serial = Word32 -- | create a new method call message msgMethodCall :: BusName -> ObjectPath -> Interface -> Member -> Body -> Message -- | create a new method return message msgMethodReturn :: Serial -> Body -> Message -- | create a new error message msgError :: ErrorName -> Serial -> Body -> Message -- | create a new signal message msgSignal :: ObjectPath -> Interface -> Member -> Body -> Message -- | read message's body using the signature field as reference readBody :: Message -> Body -- | read message's body with a defined signature readBodyWith :: Message -> Signature -> Body -- | One possible signature element data SignatureElem SigByte :: SignatureElem SigBool :: SignatureElem SigInt16 :: SignatureElem SigUInt16 :: SignatureElem SigInt32 :: SignatureElem SigUInt32 :: SignatureElem SigInt64 :: SignatureElem SigUInt64 :: SignatureElem SigDouble :: SignatureElem SigString :: SignatureElem SigObjectPath :: SignatureElem SigSignature :: SignatureElem SigArray :: SignatureElem -> SignatureElem SigStruct :: [SignatureElem] -> SignatureElem SigVariant :: SignatureElem SigDict :: SignatureElem -> SignatureElem -> SignatureElem SigUnixFD :: SignatureElem -- | A list of signature element type Signature = [SignatureElem] -- | DBus ObjectPath type ObjectPath = ByteString -- | Dbus Types data DbusType DbusByte :: Word8 -> DbusType DbusBoolean :: Bool -> DbusType DbusInt16 :: Int16 -> DbusType DbusUInt16 :: Word16 -> DbusType DbusInt32 :: Int32 -> DbusType DbusUInt32 :: Word32 -> DbusType DbusInt64 :: Int64 -> DbusType DbusUInt64 :: Word64 -> DbusType DbusDouble :: Double -> DbusType DbusString :: ByteString -> DbusType DbusObjectPath :: ObjectPath -> DbusType DbusSignature :: Signature -> DbusType DbusArray :: SignatureElem -> [DbusType] -> DbusType DbusStruct :: Signature -> [DbusType] -> DbusType DbusDict :: DbusType -> DbusType -> DbusType DbusVariant :: DbusType -> DbusType DbusUnixFD :: Word32 -> DbusType