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