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

Safe HaskellNone
LanguageHaskell2010

DBus.Message

Synopsis

Documentation

fromFlags :: (Num a, Ord a, Bits a) => a -> [Flag] Source

mkSignal :: SingI ts => Word32 -> [Flag] -> Signal ts -> Builder Source

callMethod' Source

Arguments

:: Text

Entity to send the message to

-> ObjectPath

Object

-> Text

Interface

-> Text

Member (method) name

-> [SomeDBusValue]

Arguments

-> [Flag]

Method call flags

-> DBusConnection

Connection to send the call over

-> IO (STM (Either [SomeDBusValue] [SomeDBusValue])) 

Asychronously call a method.

This is the "raw" version of callMethod. It doesn't do argument conversion.

fromResponse :: Representable a => Either [SomeDBusValue] [SomeDBusValue] -> Either MethodError a Source

Try to convert the response to a method call top Haskell types

callMethod Source

Arguments

:: (Representable args, Representable ret) 
=> Text

Entity to send the message to

-> ObjectPath

Object

-> Text

Interface

-> Text

Member (method) to call

-> args

Arguments

-> [Flag]

Method call flags

-> DBusConnection

Connection to send the call over

-> IO (Either MethodError ret) 

Synchronously call a method.

This is the "cooked" version of callMethod''. It automatically converts arguments and returns values.

If the returned value's type doesn't match the expected type a MethodSignatureMissmatch is returned

You can pass in and extract multiple arguments and return values with types that are represented by DBus Structs (e.g. tuples). More specifically, multiple arguments/return values are handled in the following way:

  • If the method returns multiple values and the RepType of the expected return value is a struct it tries to match up the arguments with the struct fields
  • If the method returns a single struct and the RepType is a struct it will try to match up those two
  • If the RepType of the expected return value is not a struct it will only match if the method returned exactly one value and those two match up (as per normal)

This means that if the RepType of the expected return value is a struct it might be matched in two ways: Either by the method returning multiple values or the method returning a single struct. At the moment there is no way to exclude either