line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Net::OBEX::Packet::Request::Connect; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
1101
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
64
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
103
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001001'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
107
|
|
10
|
2
|
|
|
2
|
|
10
|
use base qw(Class::Data::Accessor Net::OBEX::Packet::Request::Base); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1786
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
__PACKAGE__->mk_classaccessors( |
13
|
|
|
|
|
|
|
qw( |
14
|
|
|
|
|
|
|
mtu |
15
|
|
|
|
|
|
|
version |
16
|
|
|
|
|
|
|
flags |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
2
|
|
|
2
|
1
|
7
|
my $class = shift; |
22
|
2
|
50
|
|
|
|
10
|
croak "Must have even number of arguments to new()" |
23
|
|
|
|
|
|
|
if @_ & 1; |
24
|
2
|
|
|
|
|
4
|
my %args = @_; |
25
|
2
|
|
|
|
|
7
|
$args{ +lc } = delete $args{ $_ } for keys %args; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
28
|
%args = ( |
28
|
|
|
|
|
|
|
mtu => 4096, |
29
|
|
|
|
|
|
|
version => "\x10", |
30
|
|
|
|
|
|
|
flags => "\x00", |
31
|
|
|
|
|
|
|
headers => [], |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
%args, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
11
|
return bless \%args, $class; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub make { |
41
|
2
|
|
|
2
|
1
|
11208
|
my $self = shift; |
42
|
2
|
|
|
|
|
4
|
my $headers = join '', @{ $self->headers }; |
|
2
|
|
|
|
|
20
|
|
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
12
|
my $packet = $self->version . $self->flags . pack 'n', $self->mtu; |
45
|
2
|
|
|
|
|
49
|
$packet .= $headers; |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
9
|
$packet = "\x80" . (pack 'n', 3 + length $packet) . $packet; |
48
|
|
|
|
|
|
|
|
49
|
2
|
|
|
|
|
12
|
return $self->raw( $packet ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |