From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hugh Daschbach Newsgroups: gmane.emacs.bugs Subject: bug#43252: 27.1; DBus properties lack type hints or overrides Date: Tue, 08 Sep 2020 21:10:06 -0700 Message-ID: <877dt3bnfl.fsf@ccss.com> References: <87v9gqquct.fsf@ccss.com> <87imcqdo38.fsf@gmx.de> <87sgbtqylc.fsf@ccss.com> <87sgbtcvqs.fsf@gmx.de> <87pn6xqtsz.fsf@ccss.com> <87363sl4hs.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27720"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1 Cc: 43252@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 09 06:11:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFrRs-00074x-Pd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Sep 2020 06:11:09 +0200 Original-Received: from localhost ([::1]:39274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFrRr-0002JD-E8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Sep 2020 00:11:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFrRm-0002Ir-DD for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 00:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFrRm-0008Pn-2q for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 00:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFrRl-0005Kq-TL for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 00:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hugh Daschbach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Sep 2020 04:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43252 X-GNU-PR-Package: emacs Original-Received: via spool by 43252-submit@debbugs.gnu.org id=B43252.159962462320463 (code B ref 43252); Wed, 09 Sep 2020 04:11:01 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 9 Sep 2020 04:10:23 +0000 Original-Received: from localhost ([127.0.0.1]:56911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFrR8-0005Jz-Um for submit@debbugs.gnu.org; Wed, 09 Sep 2020 00:10:23 -0400 Original-Received: from mail1.ccss.com ([159.203.255.73]:58394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFrR5-0005Jg-Mn for 43252@debbugs.gnu.org; Wed, 09 Sep 2020 00:10:22 -0400 Original-Received: by mail1.ccss.com (Postfix, from userid 114) id 066AFBF8AB; Tue, 8 Sep 2020 21:10:14 -0700 (PDT) Original-Received: from ccss.com (unknown [192.168.76.11]) by mail1.ccss.com (Postfix) with ESMTP id 357D9BF877; Tue, 8 Sep 2020 21:10:13 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by ccss.com (Postfix) with ESMTP id 095B41760611; Tue, 8 Sep 2020 21:10:13 -0700 (PDT) Original-Received: from ccss.com ([127.0.0.1]) by localhost (ccss.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1lHFkargiT8f; Tue, 8 Sep 2020 21:10:07 -0700 (PDT) Original-Received: from klaatu (klaatu.lan [192.168.42.3]) (Authenticated sender: hugh) by ccss.com (Postfix) with ESMTPSA id DFB1D1760428; Tue, 8 Sep 2020 21:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ccss.com; s=mail; t=1599624606; bh=JbImnuSjy1QR40n/VVpAbOV/dFUIZPH2qq6GFCREtZg=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=ClSAD+7S4OByv0FN0nOEjd/RmAWdBpkGg3yETurP1T41jxU83wakJLcN2IBERaTmv v0EJVgsgrVZPnq2n6iwaAHORB8Wh7AbofDj9/Bk8jTgiZQSbimpOPBi6YxLg9C/BiJ 38cKdwrIAX8oTPqUbtcOIw+iFe21wgpvu/wI0/epY53eyTTZvSB3I3mSONO7qD6DaZ hutfXRBNb+QbxX7cFPIbpFz3OFpKjbAavhfIczMtsmYmlqKmZCCPMpzQGWmolDYNYu a7FIPSTe+qAux5sbC69Xd5/xDCP219OGLdQ7xQB57bF2r/jHtHe5B9pJzhHNTC9LUF xAX9f00usjGPw== In-reply-to: <87363sl4hs.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187610 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Michael Albinus writes: > Hugh Daschbach writes: > > Hi Hugh, > > I've pushed a fix to master, which shall solve the=20 > problem. Playing with > introspection, I found the problem that it stalls if there are=20 > no > introspection data. Not applicable. So I've turned to the=20 > 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,=20 > dbus-tests.el > extended accordingly. Thanks, Michael. I think I still have issues. The attached script generates two boolean properties, then issues=20 a GetManagedObjects method call. The two properties are not=20 returned, though they are in the registered objects table. The script also drops an elisp =E2=80=98dbus-get-all-managed-objects=E2=80= =99=20 request in the *scratch* buffer. If I execute that, I get a similar failure=20 to #43251. That may not be surprising. I=E2=80=99m working an a more comprehensive test that registers the=20 variety of types I need to support. I=E2=80=99ll post that when I have something=20 worth looking at. I=E2=80=99d like to present that in a form compatible with dbus-test.el rather than throw more one off scripts at you. So=20 give me a bit. I think the mechanism you implemented works well for simple types.=20 Is there a mechanism to specify the signature for an empty compound=20 type? I need arrays and dictionaries of various types. For something like a byte array, I expect I=E2=80=99ll need to interleave=20 the :byte type between each value in the array. Correct? Thanks, Hugh --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=register-property-test.el Content-Description: GetManagedObjects test. ;;; register-property-test.el --- Test program for complex :dict-entry. -*- lexical-binding: t; -*- ;; Copyright (C) 2020 Hugh Daschbach ;; Author: Hugh Daschbach ;; 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 . ;;; 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 --=-=-=--