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: Thu, 10 Sep 2020 15:53:29 -0700 [thread overview]
Message-ID: <87pn6t9rbq.fsf@ccss.com> (raw)
In-Reply-To: <87imclwow5.fsf@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]
Michael Albinus writes:
> Michael Albinus <michael.albinus@gmx.de> writes:
>
> Hi Hugh,
>
>> Reading the BlueZ D-Bus GATT API description, you seem to need
>> only
>> basic types and arrays of basic types as properties. So I will
>> start
>> adding arrays of basic types. Other, more complex compound
>> types will
>> follow later.
That's mostly true. There is another BlueZ interface
(advertising) that
take a byte keyed dictionary. It isn't obvious from the
documentation
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt.
But the Manufacturer ID described mentioned in the
ManufacturerData
dictionary description is a byte value.
The property table in the BlueZ source code looks like:
{ "ManufacturerData", "a{qv}", get_manufacturer_data,
NULL,
manufacturer_data_exists
},
(https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/advertising.c#n465)
It isn't clear that there's a commitment to support such a data
structure. The DBus info page says "Every dictionary entry has a
string
as a key".
> I have pushed my recent work to master. dbus-register-property,
> dbus-get-property, dbus-get-all-properties and
> dbus-get-all-managed-objects shall work now for your byte
> array. dbus-set-property will follow tomorrow, as well as other
> compound
> types but array.
>
With your latest work, I have successful tests for byte arrays,
string
arrays, object arrays, boolean arrays, and string keyed
dictionaries.
I haven't been able to verify property signatures programatically.
I
have turned on dbus-debug and verified signatures reported by the
message formatter. I assume introspection is in the queue. With
introspection, we could extend the tests.
I assume I shouldn't care about tests that fail with debug turned
on.
WRT byte keyed dictionaries, I've attached a failing test. I
don't know
if you want to look at it or not.
Still waiting for a response from assign@gnu.org. I assume a
delay of a
few days is to be expected.
Thanks again,
Hugh
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Test DBus byte keyed dictionary property. --]
[-- Type: text/x-patch, Size: 3151 bytes --]
^[[1mdiff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el^[[m
^[[1mindex a8e052efbef..c0e85449a37 100644^[[m
^[[1m--- a/test/lisp/net/dbus-tests.el^[[m
^[[1m+++ b/test/lisp/net/dbus-tests.el^[[m
^[[36m@@ -521,6 +521,56 @@^[[m ^[[mdbus-test05-register-property-several-paths^[[m
;; Cleanup.^[[m
(dbus-unregister-service :session dbus--test-service)))^[[m
^[[m
^[[32m+^[[m^[[32m(ert-deftest dbus-test05-register-property-types ()^[[m
^[[32m+^[[m^[[32m "Check property type preservation for an own service."^[[m
^[[32m+^[[m^[[32m (skip-unless dbus--test-enabled-session-bus)^[[m
^[[32m+^[[m^[[32m (dbus-ignore-errors (dbus-unregister-service :session dbus--test-service))^[[m
^[[32m+^[[m
^[[32m+^[[m^[[32m (unwind-protect^[[m
^[[32m+^[[m^[[32m (let ((object-array "ByteDictionary")^[[m
^[[32m+^[[m^[[32m (expected '((8^[[m
^[[32m+^[[m^[[32m ("byte eight"))^[[m
^[[32m+^[[m^[[32m (16^[[m
^[[32m+^[[m^[[32m ("byte sixteen"))^[[m
^[[32m+^[[m^[[32m (48^[[m
^[[32m+^[[m^[[32m ((8 9 10))))))^[[m
^[[32m+^[[m^[[32m (should^[[m
^[[32m+^[[m^[[32m (equal^[[m
^[[32m+^[[m^[[32m (dbus-register-property^[[m
^[[32m+^[[m^[[32m :session dbus--test-service dbus--test-path^[[m
^[[32m+^[[m^[[32m dbus--test-interface object-array :read^[[m
^[[32m+^[[m^[[32m '(:array^[[m
^[[32m+^[[m^[[32m :dict-entry (:byte 8 (:variant :string "byte-eight"))^[[m
^[[32m+^[[m^[[32m :dict-entry (:byte 16 (:variant :object-path "/byte sixteen"))^[[m
^[[32m+^[[m^[[32m :dict-entry (:byte 48 (:variant (:array :byte 8 :byte 9 :byte 10)))))^[[m
^[[32m+^[[m^[[32m `((:property :session ,dbus--test-interface ,object-array)^[[m
^[[32m+^[[m^[[32m (,dbus--test-service ,dbus--test-path))))^[[m
^[[32m+^[[m^[[32m (should^[[m
^[[32m+^[[m^[[32m (equal^[[m
^[[32m+^[[m^[[32m (dbus-get-property^[[m
^[[32m+^[[m^[[32m :session dbus--test-service dbus--test-path^[[m
^[[32m+^[[m^[[32m dbus--test-interface object-array)^[[m
^[[32m+^[[m^[[32m expected))^[[m
^[[32m+^[[m
^[[32m+^[[m
^[[32m+^[[m^[[32m ;; A test for `dbus-get-property' shall be added.^[[m
^[[32m+^[[m
^[[32m+^[[m^[[32m (let ((result^[[m
^[[32m+^[[m^[[32m (dbus-get-all-properties^[[m
^[[32m+^[[m^[[32m :session dbus--test-service dbus--test-path^[[m
^[[32m+^[[m^[[32m dbus--test-interface)))^[[m
^[[32m+^[[m^[[32m (should (equal (cdr (assoc object-array result)) expected)))^[[m
^[[32m+^[[m
^[[32m+^[[m^[[32m (let ((result^[[m
^[[32m+^[[m^[[32m (dbus-get-all-managed-objects :session dbus--test-service "/"))^[[m
^[[32m+^[[m^[[32m result)^[[m
^[[32m+^[[m^[[32m (should (setq result1 (cadr (assoc dbus--test-path result))))^[[m
^[[32m+^[[m^[[32m (should (setq result1 (cadr (assoc dbus--test-interface result1))))^[[m
^[[32m+^[[m^[[32m (should (equal (cdr (assoc object-array result1)) expected))))^[[m
^[[32m+^[[m
^[[32m+^[[m^[[32m ;; Cleanup.^[[m
^[[32m+^[[m^[[32m (dbus-unregister-service :session dbus--test-service)))^[[m
^[[32m+^[[m
(defun dbus-test-all (&optional interactive)^[[m
"Run all tests for \\[dbus]."^[[m
(interactive "p")^[[m
next prev parent reply other threads:[~2020-09-10 22:53 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
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 [this message]
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=87pn6t9rbq.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).