-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.pl
51 lines (40 loc) · 1.28 KB
/
script.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/perl
use 5.10.0;
use strict;
use warnings;
use Net::DBus;
use Net::DBus::Reactor;
use Data::Dumper;
sub catch_all {
my $con = shift;
my $msg = shift;
say "on catch all";
say "Type ".$msg->get_type;
say "Interface ".$msg->get_interface;
say "Path ".$msg->get_path;
say "Name ".$msg->get_destination;
say "enviado por ".$msg->get_sender;
say "id ".$msg->get_serial;
say "miembro ".$msg->get_member;
say "firma ".$msg->get_signature;
return if $msg->get_no_reply();
say "waiting ack ";
my @arguments = $msg->get_args_list;
say "($_)" for @arguments;
push @arguments,"on catch all";
my $reply = $con->make_method_return_message($msg);
$reply->append_args_list(@arguments);
$con->send($reply);
return 1;
}
push @INC, $ENV{HOME}."/pfpim";
use Jpd::Freesmartphone;
use Jpd::Freesmartphone::PIM;
my $bus = Net::DBus->find or die "i can't find it";
my $service = $bus->export_service("jpd.freesmartphone.PIM");
$bus->get_connection->register_fallback("/jpd/freesmartphone",\&catch_all);
my $player = Jpd::Freesmartphone->new($bus);
my $object = Jpd::Freesmartphone::PIM->new($player);
#print Dumper($object);
Net::DBus::Reactor->main->run;
exit 0;