Subject: | Net::DBus::Binding::Message missing variant type |
The module Net::DBus::Binding::Message is missing the declaration of the
type 'variant' in the hash %simple_type_map and in it's reverse lookup
%simple_type_rev_map.
The absence of this type causes the Perl library to fail when
communicating with the service provided by
'org.freedesktop.Notifications' as decribed here:
http://www.galago-project.org/specs/notification/0.9/x408.html
The error message is:
unknown simple type variant at
/usr/lib/perl5/Net/DBus/Binding/Introspector.pm line 994
A sample test case and a patch are provided.
Subject: | dbus.patch |
--- /usr/lib/perl5/Net/DBus/Binding/Introspector.pm 2006-08-29 00:03:52.000000000 +0200
+++ Introspector.pm 2006-07-06 00:34:37.000000000 +0200
@@ -53,6 +53,7 @@
use 5.006;
use strict;
use warnings;
+
use XML::Twig;
use Net::DBus::Binding::Message;
@@ -70,7 +71,6 @@
"uint64" => &Net::DBus::Binding::Message::TYPE_UINT64,
"objectpath" => &Net::DBus::Binding::Message::TYPE_OBJECT_PATH,
"signature" => &Net::DBus::Binding::Message::TYPE_SIGNATURE,
- "variant" => &Net::DBus::Binding::Message::TYPE_VARIANT,
);
our %simple_type_rev_map = (
@@ -86,7 +86,6 @@
&Net::DBus::Binding::Message::TYPE_UINT64 => "uint64",
&Net::DBus::Binding::Message::TYPE_OBJECT_PATH => "objectpath",
&Net::DBus::Binding::Message::TYPE_SIGNATURE => "signature",
- &Net::DBus::Binding::Message::TYPE_VARIANT => "variant",
);
our %magic_type_map = (
Subject: | dbus-test-case.pl |
#!/usr/bin/perl
=head1 NAME
dbus-test-case.pl - Sample DBUS test case.
=head1 SYNOPSIS
dbus-test-case.pl
=head1 DESCRIPTION
Sample program used to demonstrate a failure with the Net::DBUS API.
=head1 AUTHOR
Emmanuel Rodriguez < emmanuel.rodriguez@gmail.com >
=cut
use strict;
use warnings;
use Net::DBus;
# Main entry point
exit main();
#
# Main entry point of the program
#
sub main {
my $dbus = Net::DBus->session;
my $service = $dbus->get_service("org.freedesktop.Notifications");
my $object = $service->get_object("/org/freedesktop/Notifications");
# Send and notification
$object->Notify(
"dbus-test", # Application name
0, # replaces_id (0 -> nothing)
'', #app_icon ("" -> no icon)
'Test event', # summary
"This is a test to see if DBUS works nicely in Perl.\nI hope that this works.", # body
[], # actions
{}, # hints
2_000 # expire_timeout in milliseconds
);
return 0;
}