| None -> ());
List.iter (fun arg ->
Printf.printf " Arg: %s\n" (DBus.string_of_ty arg)
- ) (DBus.Message.get m)
+ ) (DBus.Message.get m);
+ Printf.printf "%!"
let error_callback conn err =
- Printf.printf "Received error.\n"
+ Printf.printf "Received error.\n%!"
let callbacks =
{
let msg = DBus.Message.new_method_call destination path interface meth
in msg
+let make_filter msg_type =
+ let path = "/org/freedesktop/DBus" in
+ let interface = "org.freedesktop.DBus" in
+ let meth = "AddMatch" in
+ let msg = DBus.Message.new_method_call destination path interface meth in
+ DBus.Message.append msg [(DBus.String (Printf.sprintf "type='%s'" msg_type))];
+ msg
+
let loop el conn =
while Eventloop.has_connections el || Eventloop.has_timers el
do
Dbus_conn.enable_recv conn;
ignore (Dbus_conn.send conn (make_ping ()));
ignore (Dbus_conn.send conn (make_get_machine_id ()));
+ ignore (Dbus_conn.send conn (make_filter "method_call"));
+ ignore (Dbus_conn.send conn (make_filter "method_return"));
+ ignore (Dbus_conn.send conn (make_filter "error"));
+ ignore (Dbus_conn.send conn (make_filter "signal"));
+
loop el conn
let _ =