line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
1688
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
83
|
|
2
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
157
|
|
3
|
|
|
|
|
|
|
package Net::MQTT::Message::Unsubscribe; |
4
|
|
|
|
|
|
|
$Net::MQTT::Message::Unsubscribe::VERSION = '1.163170'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Perl module to represent an MQTT Unsubscribe message |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
11
|
use base 'Net::MQTT::Message'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
205
|
|
9
|
3
|
|
|
3
|
|
14
|
use Net::MQTT::Constants qw/:all/; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
17
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub message_type { |
12
|
7
|
|
|
7
|
1
|
17
|
10 |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _default_qos { |
16
|
2
|
|
|
2
|
|
6
|
MQTT_QOS_AT_LEAST_ONCE |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
1
|
14
|
sub message_id { shift->{message_id} } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
1
|
5
|
sub topics { shift->{topics} } |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
|
3
|
sub _topics_string { join ',', @{shift->{topics}} } |
|
2
|
|
|
|
|
12
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _remaining_string { |
28
|
2
|
|
|
2
|
|
3
|
my ($self, $prefix) = @_; |
29
|
2
|
|
|
|
|
6
|
$self->message_id.' '.$self->_topics_string.' '. |
30
|
|
|
|
|
|
|
$self->SUPER::_remaining_string($prefix) |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _parse_remaining { |
34
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
35
|
1
|
|
|
|
|
2
|
my $offset = 0; |
36
|
1
|
|
|
|
|
8
|
$self->{message_id} = decode_short($self->{remaining}, \$offset); |
37
|
1
|
|
|
|
|
5
|
while ($offset < length $self->{remaining}) { |
38
|
1
|
|
|
|
|
3
|
push @{$self->{topics}}, decode_string($self->{remaining}, \$offset); |
|
1
|
|
|
|
|
6
|
|
39
|
|
|
|
|
|
|
} |
40
|
1
|
|
|
|
|
4
|
substr $self->{remaining}, 0, $offset, ''; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _remaining_bytes { |
44
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
45
|
2
|
|
|
|
|
5
|
my $o = encode_short($self->message_id); |
46
|
2
|
|
|
|
|
5
|
foreach my $name (@{$self->topics}) { |
|
2
|
|
|
|
|
4
|
|
47
|
2
|
|
|
|
|
5
|
$o .= encode_string($name); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
$o |
50
|
2
|
|
|
|
|
4
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |