Skip to content

Instantly share code, notes, and snippets.

@futuro
Created January 25, 2013 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save futuro/4634208 to your computer and use it in GitHub Desktop.
Save futuro/4634208 to your computer and use it in GitHub Desktop.
This is a log of some of my work dicking around with dbus and lisp.
; SLIME 2012-12-17
CL-USER> (in-package :stumpwm)
#<PACKAGE "STUMPWM">
STUMPWM> (ql:quickload :dbus)
To load "dbus":
Load 1 ASDF system:
dbus
; Loading "dbus"
....
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
..
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
;;; Building Closure with CHARACTER RUNES
..............
; in: LIST-DBUS-BATTERIES "/org/freedesktop/UPower"
; (STUMPWM.CONTRIB.BATTERY-PORTABLE::LIST-DBUS-BATTERIES
; "/org/freedesktop/UPower" "org.freedesktop.UPower")
;
; caught STYLE-WARNING:
; undefined function: LIST-DBUS-BATTERIES
;
; compilation unit finished
; Undefined function:
; LIST-DBUS-BATTERIES
; caught 1 STYLE-WARNING condition
(:DBUS)
STUMPWM> (defvar bat0_object (dbus::make-object-from-introspection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)) "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"))
; Evaluation aborted on NIL.
STUMPWM> (dbus::make-object-from-introspection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)) "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower")
; Evaluation aborted on NIL.
STUMPWM> (let
((connection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)))))
(dbus::authenticate (dbus::supported-authentication-mechanisms connection) connection)
(dbus::make-object-from-introspection connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"))
; in:
; LET ((CONNECTION
; (DBUS:OPEN-CONNECTION (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))))
; (LET ((STUMPWM::CONNECTION
; (DBUS:OPEN-CONNECTION (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))))
; )
;
; caught STYLE-WARNING:
; The variable CONNECTION is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<UNBOUND-VARIABLE CONNECTION {1007E2E2C3}>.
STUMPWM> (let
((connection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses))))
(dbus::authenticate (dbus::supported-authentication-mechanisms connection) connection)
(dbus::make-object-from-introspection connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower")))
; Evaluation aborted on #<END-OF-FILE {10082BA653}>.
STUMPWM> (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses))
#<DBUS:UNIX-CONNECTION {1007B766D3}>
STUMPWM> (defvar dbus-conn (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)))
DBUS-CONN
STUMPWM> dbus-conn
#<DBUS:UNIX-CONNECTION {1007D62893}>
STUMPWM> (dbus::authenticate (dbus::supported-authentication-mechanisms dbus-conn) dbus-conn)
; Evaluation aborted on #<IOLIB.STREAMS:HANGUP {1007F9AA43}>.
STUMPWM> dbus-conn
#<DBUS:UNIX-CONNECTION {1007D62893}>
STUMPWM> (dbus::supported-authentication-mechanisms dbus-conn)
; Evaluation aborted on #<IOLIB.STREAMS:HANGUP {1008143D03}>.
STUMPWM> (in-package :dbus)
#<PACKAGE "DBUS">
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (bus-connection bus) (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION))
;
; caught ERROR:
; during macroexpansion of
; (WITH-OPEN-CONNECTION (CONNECTION # # ...)
; (SUPPORTED-AUTHENTICATION-MECHANISMS CONNECTION)).
; Use *BREAK-ON-SIGNALS* to intercept.
;
; error while parsing arguments to DEFMACRO WITH-OPEN-CONNECTION:
; odd number of elements in keyword/value list: ((SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1426)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 ERROR condition
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<SB-INT:COMPILED-PROGRAM-ERROR {1003BFE273}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus)))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {1004188E63}>.
DBUS> (pprint (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus))))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {100466A1E3}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus)))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {1005272C03}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (bus-connection bus) (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION))
;
; caught ERROR:
; during macroexpansion of
; (WITH-OPEN-CONNECTION (CONNECTION # # ...)
; (SUPPORTED-AUTHENTICATION-MECHANISMS CONNECTION)).
; Use *BREAK-ON-SIGNALS* to intercept.
;
; error while parsing arguments to DEFMACRO WITH-OPEN-CONNECTION:
; odd number of elements in keyword/value list: ((SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1430)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 ERROR condition
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<SB-INT:COMPILED-PROGRAM-ERROR {10070FD353}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1431)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10082546F3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {1008254753}>
#<GENERIC-AUTHENTICATION-MECHANISM {10082547A3}>)
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1432)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {100874D3E3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {100874D443}>
#<GENERIC-AUTHENTICATION-MECHANISM {100874D493}>)
DBUS> (with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10087DD993}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {10087DD9F3}>
#<GENERIC-AUTHENTICATION-MECHANISM {10087DDA43}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection)
(close-connection connection))
#<active local stream socket, closed {100986B353}>
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10098E4043}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {10098E40A3}>
#<GENERIC-AUTHENTICATION-MECHANISM {10098E40F3}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10099160B3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {1009916113}>
#<GENERIC-AUTHENTICATION-MECHANISM {1009916163}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"
(list "org.freedesktop.DBus.Introspectable"
"org.freedesktop.DBus.Properties"
"org.freedesktop.UPower.Device")))
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {100533AF63}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"))
; Evaluation aborted on #<END-OF-FILE {10080013D3}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection))
T
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"))
; Evaluation aborted on #<END-OF-FILE {1007E67003}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list (make-instance 'interface :name "org.freedesktop.UPower"))))
#<OBJECT "/org/freedesktop/UPower/devices/battery_BAT0">
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list (make-instance 'interface :name "org.freedesktop.UPower")))))
BAT0_OBJ
DBUS> bat0_obj
#<OBJECT "/org/freedesktop/UPower/devices/battery_BAT0">
DBUS> (interface-name bat0_obj)
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1009831DF3}>.
DBUS> (object-interface bat0_obj)
; Evaluation aborted on #<SB-INT:SIMPLE-PROGRAM-ERROR "invalid number of arguments: ~S" {1003F63F93}>.
DBUS> (object-interface "org.freedesktop.UPower" bat0_obj)
#<INTERFACE "org.freedesktop.UPower">
T
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.UPower" bat0_obj) )
; Evaluation aborted on #<SB-INT:SIMPLE-PROGRAM-ERROR "invalid number of arguments: ~S" {10041D96F3}>.
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list
(make-instance 'interface :name "org.freedesktop.DBus.Introspectable")
(make-instance 'interface :name "org.freedesktop.DBus.Properties")
(make-instance 'interface :name "org.freedesktop.UPower")))))
BAT0_OBJ
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list
(make-instance 'interface :name "org.freedesktop.DBus.Introspectable")
(make-instance 'interface :name "org.freedesktop.DBus.Properties")
(make-instance 'interface :name "org.freedesktop.UPower.Device")))))
BAT0_OBJ
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.DBus.Properties" bat0_obj) "GetAll" "")
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1004E36603}>.
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.DBus.Properties" bat0_obj) "GetAll" "org.freedesktop.UPower.Devices")
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1004F94873}>.
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower")))
BAT0_OBJ
DBUS> (object-interfaces bat0_obj)
#<HASH-TABLE :TEST EQUAL :COUNT 1 {1009E6ECE3}>
DBUS>
; SLIME 2012-12-17
CL-USER> (in-package :stumpwm)
#<PACKAGE "STUMPWM">
STUMPWM> (ql:quickload :dbus)
To load "dbus":
Load 1 ASDF system:
dbus
; Loading "dbus"
....
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
..
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
;;; Building Closure with CHARACTER RUNES
..............
; in: LIST-DBUS-BATTERIES "/org/freedesktop/UPower"
; (STUMPWM.CONTRIB.BATTERY-PORTABLE::LIST-DBUS-BATTERIES
; "/org/freedesktop/UPower" "org.freedesktop.UPower")
;
; caught STYLE-WARNING:
; undefined function: LIST-DBUS-BATTERIES
;
; compilation unit finished
; Undefined function:
; LIST-DBUS-BATTERIES
; caught 1 STYLE-WARNING condition
(:DBUS)
STUMPWM> (defvar bat0_object (dbus::make-object-from-introspection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)) "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"))
; Evaluation aborted on NIL.
STUMPWM> (dbus::make-object-from-introspection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)) "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower")
; Evaluation aborted on NIL.
STUMPWM> (let
((connection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)))))
(dbus::authenticate (dbus::supported-authentication-mechanisms connection) connection)
(dbus::make-object-from-introspection connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"))
; in:
; LET ((CONNECTION
; (DBUS:OPEN-CONNECTION (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))))
; (LET ((STUMPWM::CONNECTION
; (DBUS:OPEN-CONNECTION (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))))
; )
;
; caught STYLE-WARNING:
; The variable CONNECTION is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<UNBOUND-VARIABLE CONNECTION {1007E2E2C3}>.
STUMPWM> (let
((connection (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses))))
(dbus::authenticate (dbus::supported-authentication-mechanisms connection) connection)
(dbus::make-object-from-introspection connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower")))
; Evaluation aborted on #<END-OF-FILE {10082BA653}>.
STUMPWM> (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses))
#<DBUS:UNIX-CONNECTION {1007B766D3}>
STUMPWM> (defvar dbus-conn (dbus::open-connection (make-instance 'iolib.multiplex:event-base) (dbus::system-server-addresses)))
DBUS-CONN
STUMPWM> dbus-conn
#<DBUS:UNIX-CONNECTION {1007D62893}>
STUMPWM> (dbus::authenticate (dbus::supported-authentication-mechanisms dbus-conn) dbus-conn)
; Evaluation aborted on #<IOLIB.STREAMS:HANGUP {1007F9AA43}>.
STUMPWM> dbus-conn
#<DBUS:UNIX-CONNECTION {1007D62893}>
STUMPWM> (dbus::supported-authentication-mechanisms dbus-conn)
; Evaluation aborted on #<IOLIB.STREAMS:HANGUP {1008143D03}>.
STUMPWM> (in-package :dbus)
#<PACKAGE "DBUS">
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (bus-connection bus) (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION))
;
; caught ERROR:
; during macroexpansion of
; (WITH-OPEN-CONNECTION (CONNECTION # # ...)
; (SUPPORTED-AUTHENTICATION-MECHANISMS CONNECTION)).
; Use *BREAK-ON-SIGNALS* to intercept.
;
; error while parsing arguments to DEFMACRO WITH-OPEN-CONNECTION:
; odd number of elements in keyword/value list: ((SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1426)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 ERROR condition
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<SB-INT:COMPILED-PROGRAM-ERROR {1003BFE273}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus)))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {1004188E63}>.
DBUS> (pprint (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus))))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {100466A1E3}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(supported-authentication-mechanisms (bus-connection bus)))
; Evaluation aborted on #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {1005272C03}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (bus-connection bus) (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION))
;
; caught ERROR:
; during macroexpansion of
; (WITH-OPEN-CONNECTION (CONNECTION # # ...)
; (SUPPORTED-AUTHENTICATION-MECHANISMS CONNECTION)).
; Use *BREAK-ON-SIGNALS* to intercept.
;
; error while parsing arguments to DEFMACRO WITH-OPEN-CONNECTION:
; odd number of elements in keyword/value list: ((SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1430)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (DBUS:BUS-CONNECTION DBUS:BUS)
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 ERROR condition
; caught 1 STYLE-WARNING condition
; Evaluation aborted on #<SB-INT:COMPILED-PROGRAM-ERROR {10070FD353}>.
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1431)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10082546F3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {1008254753}>
#<GENERIC-AUTHENTICATION-MECHANISM {10082547A3}>)
DBUS> (with-open-bus (bus (system-server-addresses))
(with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection)))
; in: WITH-OPEN-BUS (BUS (SYSTEM-SERVER-ADDRESSES))
; (DBUS:WITH-OPEN-BUS (DBUS:BUS (DBUS:SYSTEM-SERVER-ADDRESSES) :EVENT-BASE
; #:EVENT-BASE1432)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
; --> LET DBUS::CALL-WITH-OPEN-BUS LAMBDA
; ==>
; #'(LAMBDA (DBUS:BUS)
; (DBUS:WITH-OPEN-CONNECTION (DBUS:CONNECTION
; (MAKE-INSTANCE 'IOLIB.MULTIPLEX:EVENT-BASE)
; (DBUS:SYSTEM-SERVER-ADDRESSES))
; (DBUS:SUPPORTED-AUTHENTICATION-MECHANISMS DBUS:CONNECTION)))
;
; caught STYLE-WARNING:
; The variable BUS is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {100874D3E3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {100874D443}>
#<GENERIC-AUTHENTICATION-MECHANISM {100874D493}>)
DBUS> (with-open-connection (connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10087DD993}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {10087DD9F3}>
#<GENERIC-AUTHENTICATION-MECHANISM {10087DDA43}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection)
(close-connection connection))
#<active local stream socket, closed {100986B353}>
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10098E4043}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {10098E40A3}>
#<GENERIC-AUTHENTICATION-MECHANISM {10098E40F3}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(supported-authentication-mechanisms connection))
(#<DBUS-EXTERNAL-AUTHENTICATION-MECHANISM {10099160B3}>
#<DBUS-COOKIE-SHA1-AUTHENTICATION-MECHANISM {1009916113}>
#<GENERIC-AUTHENTICATION-MECHANISM {1009916163}>)
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection "/org/freedesktop/UPower/devices/battery_BAT0" "org.freedesktop.UPower"
(list "org.freedesktop.DBus.Introspectable"
"org.freedesktop.DBus.Properties"
"org.freedesktop.UPower.Device")))
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {100533AF63}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"))
; Evaluation aborted on #<END-OF-FILE {10080013D3}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection))
T
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"))
; Evaluation aborted on #<END-OF-FILE {1007E67003}>.
DBUS> (let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list (make-instance 'interface :name "org.freedesktop.UPower"))))
#<OBJECT "/org/freedesktop/UPower/devices/battery_BAT0">
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list (make-instance 'interface :name "org.freedesktop.UPower")))))
BAT0_OBJ
DBUS> bat0_obj
#<OBJECT "/org/freedesktop/UPower/devices/battery_BAT0">
DBUS> (interface-name bat0_obj)
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1009831DF3}>.
DBUS> (object-interface bat0_obj)
; Evaluation aborted on #<SB-INT:SIMPLE-PROGRAM-ERROR "invalid number of arguments: ~S" {1003F63F93}>.
DBUS> (object-interface "org.freedesktop.UPower" bat0_obj)
#<INTERFACE "org.freedesktop.UPower">
T
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.UPower" bat0_obj) )
; Evaluation aborted on #<SB-INT:SIMPLE-PROGRAM-ERROR "invalid number of arguments: ~S" {10041D96F3}>.
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list
(make-instance 'interface :name "org.freedesktop.DBus.Introspectable")
(make-instance 'interface :name "org.freedesktop.DBus.Properties")
(make-instance 'interface :name "org.freedesktop.UPower")))))
BAT0_OBJ
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower"
(list
(make-instance 'interface :name "org.freedesktop.DBus.Introspectable")
(make-instance 'interface :name "org.freedesktop.DBus.Properties")
(make-instance 'interface :name "org.freedesktop.UPower.Device")))))
BAT0_OBJ
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.DBus.Properties" bat0_obj) "GetAll" "")
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1004E36603}>.
DBUS> (object-invoke bat0_obj (object-interface "org.freedesktop.DBus.Properties" bat0_obj) "GetAll" "org.freedesktop.UPower.Devices")
; Evaluation aborted on #<SIMPLE-ERROR "~@<There is no applicable method for the generic function ~2I~_~S~
~I~_when called with arguments ~2I~_~S.~:>" {1004F94873}>.
DBUS> (defvar bat0_obj
(let
((connection
(open-connection (make-instance 'iolib.multiplex:event-base) (system-server-addresses))))
(authenticate (supported-authentication-mechanisms connection) connection)
(make-object-from-introspection connection
"/org/freedesktop/UPower/devices/battery_BAT0"
"org.freedesktop.UPower")))
BAT0_OBJ
DBUS> (object-interfaces bat0_obj)
#<HASH-TABLE :TEST EQUAL :COUNT 1 {1009E6ECE3}>
DBUS>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment