Modem/Adapter.pm

filter: Statementstmt 83.3% 15 / 18 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 100% 5 / 5 totaltotal 81.8% 27 / 33 CC 2 SCAR 4.4
CC
2
Cov
85%
get_alias_for
2.0
new
2.0
get_modems
2.0
CRAP 1.6
« Modem.pm ↑ Summary Modem/Adapter/Null.pm »
1 package Net::Radio::Modem::Adapter;
2  
3 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 2 our $VERSION = '0.002';
17 2 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<Net::Radio::Modem::Adapter> 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 ▶sub get_aliases { return %aliases; }
Subroutine get_aliases: called CC=1 SCAR=0.0
Pod documented
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 76 ▶{
Subroutine get_alias_for: called CC=2 SCAR=6.9
Pod documented
58 76 my %a = $_[0]->get_aliases();
59 76 ▶ defined $a{ $_[1] } and return $a{ $_[1] };
Branch: 1 branch
BranchTrueFalseTotal
defined $a{$_[1]} and return $a{$_[1]} 60 16 76
60 16 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 0 ▶{
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
73 0 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 0 ▶{
Subroutine get_modems: not called CC=1 SCAR=6.9
Pod documented
86 0 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 0 ▶{
Subroutine get_modem_property: not called CC=1 SCAR=6.9
Pod documented
100 0 die "unimplemented"; # with v5.12 we can use ...
101 }
102  
103 =head1 BUGS
104  
105 Please report any bugs or feature requests to C<bug-net-radio-modem at rt.cpan.org>, or through
106 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Radio-Modem>. 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<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>.
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<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Radio-Modem>
126  
127 If you think you've found a bug then please read "How to Report Bugs
128 Effectively" by Simon Tatham:
129 L<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>.
130  
131 =item * AnnoCPAN: Annotated CPAN documentation
132  
133 L<http://annocpan.org/dist/Net-Radio-Modem>
134  
135 =item * CPAN Ratings
136  
137 L<http://cpanratings.perl.org/d/Net-Radio-Modem>
138  
139 =item * Search CPAN
140  
141 L<http://search.cpan.org/dist/Net-Radio-Modem/>
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<< <rehsack at cpan.org> >>
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 2 1;
« Modem.pm ↑ Summary Modem/Adapter/Null.pm »