line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
51199
|
use utf8; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
19
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Net::EGTS::Packet::Appdata; |
4
|
4
|
|
|
4
|
|
453
|
use namespace::autoclean; |
|
4
|
|
|
|
|
12477
|
|
|
4
|
|
|
|
|
22
|
|
5
|
4
|
|
|
4
|
|
519
|
use Mouse; |
|
4
|
|
|
|
|
19538
|
|
|
4
|
|
|
|
|
18
|
|
6
|
|
|
|
|
|
|
extends qw(Net::EGTS::Packet); |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1389
|
use Carp; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
224
|
|
9
|
4
|
|
|
4
|
|
454
|
use List::MoreUtils qw(natatime); |
|
4
|
|
|
|
|
9207
|
|
|
4
|
|
|
|
|
27
|
|
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
2533
|
use Net::EGTS::Types; |
|
4
|
|
|
|
|
84
|
|
|
4
|
|
|
|
|
70
|
|
12
|
4
|
|
|
4
|
|
262
|
use Net::EGTS::Codes; |
|
4
|
|
|
|
|
64
|
|
|
4
|
|
|
|
|
916
|
|
13
|
4
|
|
|
4
|
|
268
|
use Net::EGTS::Util qw(usize); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
803
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Service Data Record |
16
|
|
|
|
|
|
|
has SDR => is => 'rw', isa => 'Maybe[BINARY]'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
after 'decode' => sub { |
19
|
|
|
|
|
|
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
die 'Packet not EGTS_PT_APPDATA type' |
21
|
|
|
|
|
|
|
unless $self->PT == EGTS_PT_APPDATA; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$self->SDR( $self->SFRD ); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
before 'encode' => sub { |
27
|
|
|
|
|
|
|
my ($self) = @_; |
28
|
|
|
|
|
|
|
die 'Packet not EGTS_PT_APPDATA type' |
29
|
|
|
|
|
|
|
unless $self->PT == EGTS_PT_APPDATA; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$self->SFRD( $self->SDR ); |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
around BUILDARGS => sub { |
35
|
|
|
|
|
|
|
my $orig = shift; |
36
|
|
|
|
|
|
|
my $class = shift; |
37
|
|
|
|
|
|
|
return $class->$orig( @_, PT => EGTS_PT_APPDATA ); |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
augment as_debug => sub { |
41
|
|
|
|
|
|
|
my ($self) = @_; |
42
|
4
|
|
|
4
|
|
21
|
use bytes; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
17
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my @bytes = ((unpack('B*', $self->SFRD)) =~ m{.{8}}g); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my @str; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $it = natatime 4, @bytes; |
49
|
|
|
|
|
|
|
my @chunks; |
50
|
|
|
|
|
|
|
while (my @vals = $it->()) { |
51
|
|
|
|
|
|
|
push @chunks, join(' ', @vals); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
push @str => sprintf('SDR: %s', join("\n ", @chunks)); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return @str; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |