line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
33
|
use strict; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
168
|
|
2
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
230
|
|
3
|
|
|
|
|
|
|
package Device::RFXCOM::Decoder; |
4
|
|
|
|
|
|
|
$Device::RFXCOM::Decoder::VERSION = '1.142010'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Device::RFXCOM::Decoder base class for decoding RF messages |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
167
|
use 5.006; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
230
|
|
9
|
5
|
|
|
5
|
|
25
|
use constant DEBUG => $ENV{DEVICE_RFXCOM_DECODER_DEBUG}; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
270
|
|
10
|
5
|
|
|
5
|
|
28
|
use Carp qw/croak/; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
225
|
|
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
|
28
|
use Exporter; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1446
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw(lo_nibble hi_nibble nibble_sum) ] ); |
16
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
17
|
|
|
|
|
|
|
our @EXPORT = qw(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
72
|
|
|
72
|
1
|
60063
|
my $pkg = shift; |
22
|
72
|
|
|
|
|
317
|
bless { @_ }, $pkg; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub lo_nibble { |
27
|
96
|
|
|
96
|
1
|
233
|
$_[0]&0xf; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub hi_nibble { |
32
|
100
|
|
|
100
|
1
|
314
|
($_[0]&0xf0)>>4; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub nibble_sum { |
37
|
171
|
|
|
171
|
1
|
181
|
my $s = 0; |
38
|
171
|
|
|
|
|
290
|
foreach (0..$_[0]-1) { |
39
|
3137
|
|
|
|
|
3935
|
$s += $_[1]->[$_]; |
40
|
|
|
|
|
|
|
} |
41
|
171
|
|
|
|
|
652
|
return $s; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |