oFono/Manager.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« oFono.pm ↑ Summary oFono/Roles/Manager.pm »
1 package Net::Radio::oFono::Manager;
2  
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Net::Radio::oFono::Manager - access to oFono's Manager objects
10  
11 =cut
12  
13 our $VERSION = '0.001';
14  
15 0 ▶use Net::Radio::oFono::Roles::Manager qw(Modem); # injects GetModem(s) etc.
Subroutine BEGIN: called CC=1 SCAR=2.6
16 use base
17 qw(Net::Radio::oFono::Helpers::EventMgr Net::Radio::oFono::Roles::RemoteObj Net::Radio::oFono::Roles::Manager);
18  
19 use Net::DBus qw(:typing);
20  
21 =head1 SYNOPSIS
22  
23 Provides access to oFono's Modem Manager object (org.ofono.Manager interface).
24  
25 use Net::Radio::oFono::Manager;
26 ...
27 my $manager = Net::Radio::oFono::Manager->new(
28 ON_MODEM_ADDED => \&on_modem_added,
29 ON_MODEM_REMOVED => \&on_modem_removed,
30 );
31  
32 Usually L<Net::Radio::oFono> does all of it for you, including modem
33 management and interface instantiation.
34  
35 =head1 INHERITANCE
36  
37 Net::Radio::oFono::Manager
38 ISA Net::Radio::oFono::Helpers::EventMgr
39 DOES Net::Radio::oFono::Roles::RemoteObj
40 DOES Net::Radio::oFono::Roles::Manager
41  
42 =head1 METHODS
43  
44 =head2 new(;%events)
45  
46 Instantiates new modem manager.
47  
48 =cut
49  
50 sub new
51 {
52 my ( $class, %events ) = @_;
53  
54 my $self = $class->SUPER::new(%events);
55  
56 bless( $self, $class );
57  
58 $self->_init();
59  
60 return $self;
61 }
62  
63 =head2 init()
64  
65 Initialized RemoteObj and Manager roles.
66  
67 =cut
68  
69 sub _init
70 {
71 my $self = $_[0];
72  
73 # initialize roles
74 $self->Net::Radio::oFono::Roles::RemoteObj::_init( "/", "org.ofono.Manager" );
75 $self->Net::Radio::oFono::Roles::Manager::_init();
76  
77 return;
78 }
79  
80 sub DESTROY
81 {
82 my $self = $_[0];
83  
84 # destroy roles
85 $self->Net::Radio::oFono::Roles::Manager::DESTROY();
86 $self->Net::Radio::oFono::Roles::RemoteObj::DESTROY();
87  
88 # destroy base class
89 $self->Net::Radio::oFono::Helpers::EventMgr::DESTROY();
90  
91 return;
92 }
93  
94 =head2 GetModems(;$force)
95  
96 Alias for L<Net::Radio::oFono::Roles::Manager/GetObjects>.
97  
98 =head2 GetModem($object_path;$force)
99  
100 Alias for L<Net::Radio::oFono::Roles::Manager/GetObject>.
101  
102 =cut
103  
104 =head1 BUGS
105  
106 Please report any bugs or feature requests to C<bug-net-radio-ofono at rt.cpan.org>, or through
107 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Radio-oFono>. I will be notified, and then you'll
108 automatically be notified of progress on your bug as I make changes.
109  
110 If you think you've found a bug then please read "How to Report Bugs
111 Effectively" by Simon Tatham:
112 L<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>.
113  
114 =head1 SUPPORT
115  
116 You can find documentation for this module with the perldoc command.
117  
118 perldoc Net::Radio::oFono
119  
120 You can also look for information at:
121  
122 =over 4
123  
124 =item * RT: CPAN's request tracker (report bugs here)
125  
126 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Radio-oFono>
127  
128 If you think you've found a bug then please read "How to Report Bugs
129 Effectively" by Simon Tatham:
130 L<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>.
131  
132 =item * AnnoCPAN: Annotated CPAN documentation
133  
134 L<http://annocpan.org/dist/Net-Radio-oFono>
135  
136 =item * CPAN Ratings
137  
138 L<http://cpanratings.perl.org/d/Net-Radio-oFono>
139  
140 =item * Search CPAN
141  
142 L<http://search.cpan.org/dist/Net-Radio-oFono/>
143  
144 =back
145  
146 =head2 Where can I go for help with a concrete version?
147  
148 Bugs and feature requests are accepted against the latest version
149 only. To get patches for earlier versions, you need to get an
150 agreement with a developer of your choice - who may or not report the
151 issue and a suggested fix upstream (depends on the license you have
152 chosen).
153  
154 =head2 Business support and maintenance
155  
156 For business support you can contact Jens via his CPAN email
157 address rehsackATcpan.org. Please keep in mind that business
158 support is neither available for free nor are you eligible to
159 receive any support based on the license distributed with this
160 package.
161  
162 =head1 ACKNOWLEDGEMENTS
163  
164 At first the guys from the oFono-Team shall be named: Marcel Holtmann and
165 Denis Kenzior, the maintainers and all the people named in ofono/AUTHORS.
166 Without their effort, there would no need for a Net::Radio::oFono module.
167  
168 Further, Peter "ribasushi" Rabbitson helped a lot by providing hints
169 and support how to make this API accessor a valuable CPAN module.
170  
171 =head1 AUTHOR
172  
173 Jens Rehsack, C<< <rehsack at cpan.org> >>
174  
175 =head1 LICENSE AND COPYRIGHT
176  
177 Copyright 2012 Jens Rehsack.
178  
179 This program is free software; you can redistribute it and/or modify it
180 under the terms of either: the GNU General Public License as published
181 by the Free Software Foundation; or the Artistic License.
182  
183 See http://dev.perl.org/licenses/ for more information.
184  
185  
186 =cut
187  
188 1;
« oFono.pm ↑ Summary oFono/Roles/Manager.pm »