line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Device::MindWave::Packet::Dongle::HeadsetFound; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
33351
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
179
|
|
4
|
5
|
|
|
5
|
|
64
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
510
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
881
|
use Device::MindWave::Utils qw(checksum); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
309
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
28
|
use base qw(Device::MindWave::Packet::Dongle); |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
3695
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
9
|
|
|
9
|
1
|
40
|
my ($class, $bytes, $index) = @_; |
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
|
|
51
|
my $self = { headset_upper => $bytes->[$index + 2], |
15
|
|
|
|
|
|
|
headset_lower => $bytes->[$index + 3] }; |
16
|
9
|
|
|
|
|
43
|
bless $self, $class; |
17
|
9
|
|
|
|
|
46
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub code |
21
|
|
|
|
|
|
|
{ |
22
|
1
|
|
|
1
|
1
|
725
|
return 0xD0; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub as_bytes |
26
|
|
|
|
|
|
|
{ |
27
|
5
|
|
|
5
|
1
|
13
|
my ($self) = @_; |
28
|
|
|
|
|
|
|
|
29
|
5
|
|
|
|
|
43
|
return [ 0xD0, 0x02, |
30
|
|
|
|
|
|
|
$self->{'headset_upper'}, |
31
|
|
|
|
|
|
|
$self->{'headset_lower'} ]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub length |
35
|
|
|
|
|
|
|
{ |
36
|
1
|
|
|
1
|
1
|
7
|
return 4; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub as_string |
40
|
|
|
|
|
|
|
{ |
41
|
1
|
|
|
1
|
1
|
983
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
39
|
return sprintf "Headset (%X%X) found", |
44
|
|
|
|
|
|
|
$self->{'headset_upper'}, |
45
|
|
|
|
|
|
|
$self->{'headset_lower'}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |