unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Hugh Daschbach <hugh@ccss.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 43252@debbugs.gnu.org
Subject: bug#43252: 27.1; DBus properties lack type hints or overrides
Date: Tue, 08 Sep 2020 21:10:06 -0700	[thread overview]
Message-ID: <877dt3bnfl.fsf@ccss.com> (raw)
In-Reply-To: <87363sl4hs.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]


Michael Albinus writes:

> Hugh Daschbach <hugh@ccss.com> writes:
>
> Hi Hugh,
>
> I've pushed a fix to master, which shall solve the 
> problem. Playing with
> introspection, I found the problem that it stalls if there are 
> no
> introspection data. Not applicable. So I've turned to the 
> alternative
> approach, allowing type symbols in `dbus-set-property' and
> `dbus-register-property'. You could call now
>
> (dbus-register-property :session "org.gnu.Emacs" "/node1"
>  "org.bluez.GattService1" "Device" :readwrite
>  :object-path "/path/node1")
>
> Similar in `dbus-set-property'. Documentation is adapted, 
> dbus-tests.el
> extended accordingly.

Thanks, Michael.  I think I still have issues.

The attached script generates two boolean properties, then issues 
a
GetManagedObjects method call.  The two properties are not 
returned,
though they are in the registered objects table.

The script also drops an elisp ‘dbus-get-all-managed-objects’ 
request in
the *scratch* buffer.  If I execute that, I get a similar failure 
to
#43251.  That may not be surprising.

I’m working an a more comprehensive test that registers the 
variety of
types I need to support.  I’ll post that when I have something 
worth
looking at.  I’d like to present that in a form compatible with
dbus-test.el rather than throw more one off scripts at you.  So 
give me
a bit.

I think the mechanism you implemented works well for simple types. 
Is
there a mechanism to specify the signature for an empty compound 
type?
I need arrays and dictionaries of various types.

For something like a byte array, I expect I’ll need to interleave 
the
:byte type between each value in the array.  Correct?

Thanks,
Hugh


[-- Attachment #2: GetManagedObjects test. --]
[-- Type: text/plain, Size: 2300 bytes --]

;;; register-property-test.el --- Test program for complex :dict-entry.  -*- lexical-binding: t; -*-

;; Copyright (C) 2020  Hugh Daschbach

;; Author: Hugh Daschbach <hugh@ccss.com>
;; Keywords: tools

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; This program demonstrates an error in handling D-Bus properties
;; interface.
;;

;;; Code:

(require 'dbus)
(dbus-register-service :system "org.gnu.Emacs")

(defun main ()
  (interactive)
  (setq dbus-debug t)
  (setq debug-on-error t)

  ;; Boolean

  (dbus-register-property :system "org.gnu.Emacs"
                          "/org/gnu/Emacs/hci0/dev_45_6d_61_63_73_01/service0002/characteristic0003"
                          "org.bluez.GattCharacteristic1"
                          "Discoverable-untyped" :read nil t)

  (dbus-register-property :system "org.gnu.Emacs"
                          "/org/gnu/Emacs/hci0/dev_45_6d_61_63_73_01/service0002/characteristic0003"
                          "org.bluez.GattCharacteristic1"
                          "Discoverable-typed" :read :boolean nil t)
  
  (sit-for 1)
  (start-process "gmo" "*GMO*"
                  "dbus-send"
                  "--system"
                  "--print-reply"
                  "--type=method_call"
                  "--system"
                  "--dest=org.gnu.Emacs"
                  "/"
                  "org.freedesktop.DBus.ObjectManager.GetManagedObjects")
  (switch-to-buffer "*scratch*")
  (insert "(pp (dbus-get-all-managed-objects :system \"org.gnu.Emacs\" \"/\"))\n")
  (sit-for 1)
  (split-window-right)
  (switch-to-buffer "*GMO*")
  (goto-char (point-min)))

(provide 'register-property-test)

;;; register-property-test.el ends here

  reply	other threads:[~2020-09-09  4:10 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  0:54 bug#43252: 27.1; DBus properties lack type hints or overrides Hugh Daschbach
2020-09-07  7:48 ` Michael Albinus
2020-09-07 17:35   ` Hugh Daschbach
2020-09-07 18:00     ` Michael Albinus
2020-09-07 19:18       ` Hugh Daschbach
2020-09-08 14:36         ` Michael Albinus
2020-09-09  4:10           ` Hugh Daschbach [this message]
2020-09-09  4:25             ` Hugh Daschbach
2020-09-09 13:25             ` Michael Albinus
2020-09-09 16:12               ` Hugh Daschbach
2020-09-09 17:43                 ` Michael Albinus
     [not found]                 ` <874ko6979w.fsf@gmx.de>
     [not found]                   ` <87v9gm9x9i.fsf@ccss.com>
2020-09-10 14:59                     ` Michael Albinus
2020-09-10 16:57                       ` Michael Albinus
2020-09-10 19:09                         ` Hugh Daschbach
2020-09-11  8:46                           ` Michael Albinus
2020-09-10 22:53                         ` Hugh Daschbach
2020-09-11  9:57                           ` Michael Albinus
2020-09-11 14:19                           ` Michael Albinus
2020-09-15  4:05                             ` Hugh Daschbach
2020-09-16 12:47                               ` Michael Albinus
2020-09-16 22:23                                 ` Hugh Daschbach
2020-09-17 12:58                                   ` Michael Albinus
2020-09-17 18:42                                     ` Hugh Daschbach
2020-09-18  6:28                                       ` Hugh Daschbach
2020-09-18  9:55                                         ` Michael Albinus
2020-09-18 13:42                                         ` Michael Albinus
2020-09-18 15:50                                           ` Michael Albinus
2020-09-18  9:36                                       ` Michael Albinus
2020-09-19  3:32                                         ` Hugh Daschbach
2020-09-20 15:05                                           ` Michael Albinus
2020-09-21 11:50                                             ` Michael Albinus
2020-09-22  3:48                                               ` Hugh Daschbach
2020-09-22 16:09                                                 ` Michael Albinus
2020-09-22 17:36                                                 ` Michael Albinus
2020-09-23  3:30                                                   ` Hugh Daschbach
2020-09-23  3:34                                                     ` Hugh Daschbach
2020-09-23  7:44                                                     ` Michael Albinus
2020-09-23 17:32                                                     ` Michael Albinus
2020-09-24  3:02                                                       ` Hugh Daschbach
2020-09-24  8:48                                                         ` Michael Albinus
2020-09-25  4:16                                                           ` Hugh Daschbach
2020-09-26  1:27                                                             ` Hugh Daschbach
2020-09-26  9:51                                                               ` Michael Albinus
2020-09-28  3:00                                                                 ` Hugh Daschbach
2020-09-28 12:55                                                                   ` Michael Albinus
2020-09-28 23:17                                                                     ` Hugh Daschbach
2020-09-29 12:22                                                                       ` Michael Albinus
2020-09-29 21:51                                                                         ` Hugh Daschbach
2020-09-30  9:34                                                                           ` Michael Albinus
2020-09-30 10:42                                                                             ` Michael Albinus
2020-09-30 16:39                                                                               ` Hugh Daschbach
2020-09-10  8:00 ` bug#43252: Fwd: " Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877dt3bnfl.fsf@ccss.com \
    --to=hugh@ccss.com \
    --cc=43252@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).