line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
1561
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
88
|
|
2
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
107
|
|
3
|
|
|
|
|
|
|
package Net::MQTT::Message::SubAck; |
4
|
|
|
|
|
|
|
$Net::MQTT::Message::SubAck::VERSION = '1.143260'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Perl module to represent an MQTT SubAck message |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
10
|
use base 'Net::MQTT::Message'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
189
|
|
9
|
3
|
|
|
3
|
|
13
|
use Net::MQTT::Constants qw/:all/; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
13
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub message_type { |
12
|
7
|
|
|
7
|
1
|
15
|
9 |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
4
|
1
|
10
|
sub message_id { shift->{message_id} } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
1
|
8
|
sub qos_levels { shift->{qos_levels} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _remaining_string { |
22
|
2
|
|
|
2
|
|
3
|
my ($self, $prefix) = @_; |
23
|
2
|
|
|
|
|
4
|
$self->message_id.'/'. |
24
|
2
|
|
|
|
|
5
|
(join ',', map { qos_string($_) } @{$self->qos_levels}). |
|
2
|
|
|
|
|
3
|
|
25
|
|
|
|
|
|
|
' '.$self->SUPER::_remaining_string($prefix) |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _parse_remaining { |
29
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
30
|
1
|
|
|
|
|
2
|
my $offset = 0; |
31
|
1
|
|
|
|
|
9
|
$self->{message_id} = decode_short($self->{remaining}, \$offset); |
32
|
1
|
|
|
|
|
5
|
while ($offset < length $self->{remaining}) { |
33
|
1
|
|
|
|
|
2
|
push @{$self->{qos_levels}}, decode_byte($self->{remaining}, \$offset)&0x3; |
|
1
|
|
|
|
|
4
|
|
34
|
|
|
|
|
|
|
} |
35
|
1
|
|
|
|
|
4
|
substr $self->{remaining}, 0, $offset, ''; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _remaining_bytes { |
39
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
40
|
2
|
|
|
|
|
4
|
my $o = encode_short($self->message_id); |
41
|
2
|
|
|
|
|
2
|
foreach my $qos (@{$self->qos_levels}) { |
|
2
|
|
|
|
|
5
|
|
42
|
2
|
|
|
|
|
4
|
$o .= encode_byte($qos); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
$o |
45
|
2
|
|
|
|
|
5
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |