Skip to content

How to specify composite types in signal handlers #17

@r13l

Description

@r13l

I’m writing a signal handler for signal-cli’s D-Bus service; the MessageReceived signal has two arrays in its type signature ("x" "s" "ay" "s" "as"). How should I specify a signal handler for that signal? Here’s what I’ve got so far:

(dbus:define-dbus-object signal-service (:path "/org/asamk/Signal"))
(dbus:define-dbus-signal-handler (signal-service message-received) ((timestamp :int64) (source :string) (group-id (:array :byte)) (message :string) (attachments (:array :string)))
          (:interface "org.asamk.Signal")
          (with-open-file (log #P"/tmp/messages" :if-exists :append :direction :output :if-does-not-exist :create)
            (format log "~&~a ~a ~a ~a ~a~%" timestamp source group-id message attachments)))

I did read the source and noticed that DEFINE-DBUS-SIGNAL-HANDLER uses SECOND on the parameters, so it looks like I oughtn’t use e.g (group-id :array :byte). I also looked through all the previous issues & in the examples directory for hints.

The example above has no effect, not even a SLIME debugger. I’ve also tried the name on-message-received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions