File Coverage

blib/lib/Net/Radio/Modem/Adapter.pm
Criterion Covered Total %
statement 13 16 81.2
branch 2 2 100.0
condition n/a
subroutine 5 8 62.5
pod 5 5 100.0
total 25 31 80.6


line stmt bran cond sub pod time code
1             package Net::Radio::Modem::Adapter;
2              
3 1     1   17 use 5.010;
  1         4  
  1         54  
4              
5 1     1   5 use strict;
  1         2  
  1         32  
6 1     1   4 use warnings;
  1         2  
  1         4215  
7              
8             =head1 NAME
9              
10             Net::Radio::Modem::Adapter - base class for adapters to access radio network modems
11              
12             =head1 METHODS
13              
14             =cut
15              
16             our $VERSION = '0.002';
17             my %aliases = (
18             MNC => 'MobileNetworkCode',
19             MCC => 'MobileCountryCode',
20             IMSI => 'InternationalMobileSubscriberIdentity',
21             SNR => 'SerialNumber',
22             LAC => 'LocationAreaCode',
23             MSISDN => 'MobileSubscriberISDN',
24             CI => 'CellId',
25             );
26              
27             =head2 get_aliases
28              
29             Returns the associative list of known aliases.
30              
31             C known only abbreviations:
32              
33             MNC => 'MobileNetworkCode',
34             MCC => 'MoileCountryCode',
35             IMSI => 'InternationalMobileSubscriberIdentity',
36             SNR => 'SerialNumber',
37             LAC => 'LocationAreaCode',
38             MSISDN => 'MobileSubscriberISDN',
39             CI => 'CellId',
40              
41             But derived classes may know more.
42              
43             =cut
44              
45 76     76 1 361 sub get_aliases { return %aliases; }
46              
47             =head2 get_alias_for($property)
48              
49             Returns the alias for given property if known, the property (name) otherwise.
50              
51             $adapter->get_alias_for('MNC'); # returns MobileNetworkCode
52             $adapter->get_alias_for('CellId'); # returns CellId
53              
54             =cut
55              
56             sub get_alias_for
57             {
58 76     76 1 154 my %a = $_[0]->get_aliases();
59 76 100       426 defined $a{ $_[1] } and return $a{ $_[1] };
60 16         55 return $_[1];
61             }
62              
63             =head2 new
64              
65             Placeholder for initalization routine / constructor for derived N:R:M:A
66              
67             Throws "unimplemented".
68              
69             =cut
70              
71             sub new
72             {
73 0     0 1   die "unimplemented"; # with v5.12 we can use ...
74             }
75              
76             =head2 get_modems
77              
78             Placeholder for method returning the list of known modems.
79              
80             Throws "unimplemented".
81              
82             =cut
83              
84             sub get_modems
85             {
86 0     0 1   die "unimplemented"; # with v5.12 we can use ...
87             }
88              
89             =head2 get_modem_property
90              
91             Placeholder for method returning the value of named property for specified
92             modem device.
93              
94             Throws "unimplemented".
95              
96             =cut
97              
98             sub get_modem_property
99             {
100 0     0 1   die "unimplemented"; # with v5.12 we can use ...
101             }
102              
103             =head1 BUGS
104              
105             Please report any bugs or feature requests to C, or through
106             the web interface at L. I will be notified, and then you'll
107             automatically be notified of progress on your bug as I make changes.
108              
109             If you think you've found a bug then please read "How to Report Bugs
110             Effectively" by Simon Tatham:
111             L.
112              
113             =head1 SUPPORT
114              
115             You can find documentation for this module with the perldoc command.
116              
117             perldoc Net::Radio::Modem
118              
119             You can also look for information at:
120              
121             =over 4
122              
123             =item * RT: CPAN's request tracker (report bugs here)
124              
125             L
126              
127             If you think you've found a bug then please read "How to Report Bugs
128             Effectively" by Simon Tatham:
129             L.
130              
131             =item * AnnoCPAN: Annotated CPAN documentation
132              
133             L
134              
135             =item * CPAN Ratings
136              
137             L
138              
139             =item * Search CPAN
140              
141             L
142              
143             =back
144              
145             =head2 Where can I go for help with a concrete version?
146              
147             Bugs and feature requests are accepted against the latest version
148             only. To get patches for earlier versions, you need to get an
149             agreement with a developer of your choice - who may or not report the
150             issue and a suggested fix upstream (depends on the license you have
151             chosen).
152              
153             =head2 Business support and maintenance
154              
155             For business support you can contact Jens via his CPAN email
156             address rehsackATcpan.org. Please keep in mind that business
157             support is neither available for free nor are you eligible to
158             receive any support based on the license distributed with this
159             package.
160              
161             =head1 ACKNOWLEDGEMENTS
162              
163             =head1 AUTHOR
164              
165             Jens Rehsack, C<< >>
166              
167             =head1 LICENSE AND COPYRIGHT
168              
169             Copyright 2012 Jens Rehsack.
170              
171             This program is free software; you can redistribute it and/or modify it
172             under the terms of either: the GNU General Public License as published
173             by the Free Software Foundation; or the Artistic License.
174              
175             See http://dev.perl.org/licenses/ for more information.
176              
177             =cut
178              
179             1;