From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Llu=C3=ADs?= Newsgroups: gmane.emacs.devel Subject: Re: [dbus] type errors Date: Mon, 03 Dec 2012 16:18:05 -0500 Message-ID: <87vcciygvm.fsf@fimbulvetr.bsc.es> References: <87pq2rkoex.fsf@fimbulvetr.bsc.es> <87pq2rhstu.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1354569505 2622 80.91.229.3 (3 Dec 2012 21:18:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2012 21:18:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 03 22:18:37 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TfdPQ-0006Oi-Jd for ged-emacs-devel@m.gmane.org; Mon, 03 Dec 2012 22:18:36 +0100 Original-Received: from localhost ([::1]:50201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfdPE-0006M8-OJ for ged-emacs-devel@m.gmane.org; Mon, 03 Dec 2012 16:18:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfdP7-0006Kg-Cb for emacs-devel@gnu.org; Mon, 03 Dec 2012 16:18:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfdP0-0000nX-QO for emacs-devel@gnu.org; Mon, 03 Dec 2012 16:18:17 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:52530) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TfdP0-0000nC-HK for emacs-devel@gnu.org; Mon, 03 Dec 2012 16:18:10 -0500 Original-Received: (qmail invoked by alias); 03 Dec 2012 21:18:08 -0000 Original-Received: from ool-43577409.dyn.optonline.net (EHLO localhost) [67.87.116.9] by mail.gmx.net (mp016) with SMTP; 03 Dec 2012 22:18:08 +0100 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX191qJU+LzZ13MEIhyCaoxq/KBe7Fn3H8WJXIZHnQe kvrVvASeCXibD2 Mail-Followup-To: Michael Albinus , emacs-devel@gnu.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155220 Archived-At: Michael Albinus writes: > Llu=C3=ADs writes: >> Hi there, > Hi, >> I've been trying to register a dbus method which is supposed to return a= list of >> elements with the following dbus signature: sssbxxa{sv} (method "GetEven= ts" in >> "org.gnome.Shell.CalendarServer"). > You mean you wrote an own handler which reacts on > "org.gnome.Shell.CalendarServer.GetEvents"? I'm not sure about the nomenclature. Here's what I did (gets called when clicking on the calendar "widget"): #v+ (dbus-register-method :session "org.gnome.Shell.CalendarServer" "/org/gnome/Shell/CalendarServer" "org.gnome.Shell.CalendarServer" "GetEvents" 'ogc:--dbus-get-events) #v- >> When returning the results, a backtrace pops up with the following error= for >> the "b" argument): >>=20 >> Debugger entered--Lisp error: (wrong-type-argument D-Bus 63490176000) >> dbus-message-internal(2 :session ":1.15" 18130 ...) >> apply(dbus-message-internal 2 :session ":1.15" 18130 (...)) >> dbus-method-return-internal(:session ":1.15" 18130 ...) >> apply(dbus-method-return-internal :session ":1.15" 18130 (...)) > Boolean requests values `t' or `nil'. Not an integer. Bad paste, sorry. This is the back trace: #v+ Debugger entered--Lisp error: (wrong-type-argument D-Bus nil) dbus-message-internal(2 :session ":1.15" 18386 ("" "Test" "" nil 63490176= 000 63490176001)) apply(dbus-message-internal 2 :session ":1.15" 18386 ("" "Test" "" nil 63= 490176000 63490176001)) dbus-method-return-internal(:session ":1.15" 18386 ("" "Test" "" nil 6349= 0176000 63490176001)) apply(dbus-method-return-internal :session ":1.15" 18386 ("" "Test" "" ni= l 63490176000 63490176001)) #v- And here's a test handler: #v+ (defun ogc:--dbus-get-events (since until force-reload) '(("" "Test" "" nil 63490176000 63490176001))) #v- >> And for the "x" argument: >>=20 >> (wrong-type-argument D-Bus 63490176000) > Per default, UINT32 is assumed. If you want to return INT64, you must > specify the type for that value. Something like ... :int64 63490176000 ... Adding a ":int64" also throws an error. >> According to the docs in `dbus', these objects should be automatically >> translated to their dbus counterparts (at least on `dbus-call-method'). > The signature of a method is not analyzed in dbus.el. That's why you must > always specify the correct type, if you want to have something different > but the default type. > See (info "(dbus)Type Conversion") Does not seem to exist in my currently installed package... (latest jd's emacs-snapshot). Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth