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