X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=lsp-dbus%2Flsp-dbus-events.lsp;h=634ab07ae2b33a12fef672e637456536d8a9c324;hb=c1126d9819f511a13e36867bb6d291170627fb8f;hp=3bde66144bc3295361f58f956cfde93e3c943cec;hpb=121167c737403e2f49231fd5704aae86850b5b38;p=rrq%2Flsp-utils.git diff --git a/lsp-dbus/lsp-dbus-events.lsp b/lsp-dbus/lsp-dbus-events.lsp index 3bde661..634ab07 100644 --- a/lsp-dbus/lsp-dbus-events.lsp +++ b/lsp-dbus/lsp-dbus-events.lsp @@ -44,9 +44,7 @@ (write-line 2 (format "** No handler %s for:\n%s" KEY (string MSG)))) (define (process-message MSG) - ;;(die nil (list 'process-message MSG)) (let ((KEY (message-key MSG))) - ;;(die nil "Dbus:process-message" KEY (and (RECV KEY) true)) (if (RECV KEY) ($it (lookup "" MSG)) (no-handler KEY MSG)))) @@ -58,7 +56,6 @@ ;; asyncronous events (define (main-loop S) (let ((FDS (list 0 (:%socket SYSTEM-BUS))) (FD nil)) - ;;(die nil "Dbus:main-loop" (length pending) "pending") (write 2 (string "> ")) (while (or pending (not (member 0 (net-select FDS "r" -1)))) (if (pop pending) (process-message $it) @@ -67,9 +64,12 @@ )) "main-loop: ")) +(define (human-msg MSG) + (human-bytes (unpack (dup "b" (length MSG)) MSG))) + ;; Send message, then keep reading messages until there is a reply (define (send-recv-message MSG) - ;;(die nil (list 'send-recv-message (octals-string MSG))) + ;;(die nil (list 'send-recv-message (human-msg MSG))) (net-send (:%socket SYSTEM-BUS) MSG) (let ((REPLY nil)) (while (nil? REPLY)