line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Inputs; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
55650616
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
72
|
|
4
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# Had never been tested. |
7
|
1
|
|
|
1
|
|
361
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
300
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $seen; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %mouseInterface = ( |
12
|
|
|
|
|
|
|
1 => 'Other', |
13
|
|
|
|
|
|
|
2 => 'Unknown', |
14
|
|
|
|
|
|
|
3 => 'Serial', |
15
|
|
|
|
|
|
|
4 => 'PS/2', |
16
|
|
|
|
|
|
|
5 => 'Infrared', |
17
|
|
|
|
|
|
|
6 => 'HP-HIL', |
18
|
|
|
|
|
|
|
7 => 'Bus Mouse', |
19
|
|
|
|
|
|
|
8 => 'ADB (Apple Desktop Bus)', |
20
|
|
|
|
|
|
|
160 => 'Bus Mouse DB-9', |
21
|
|
|
|
|
|
|
161 => 'Bus Mouse Micro-DIN', |
22
|
|
|
|
|
|
|
162 => 'USB', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub isEnabled { |
26
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
27
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{input}; |
28
|
0
|
|
|
|
|
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub doInventory { |
32
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
37
|
|
|
|
|
|
|
class => 'Win32_Keyboard', |
38
|
|
|
|
|
|
|
properties => [ qw/Name Caption Manufacturer Description Layout/ ] |
39
|
|
|
|
|
|
|
)) { |
40
|
0
|
|
|
|
|
|
my $input = { |
41
|
|
|
|
|
|
|
NAME => $object->{Name}, |
42
|
|
|
|
|
|
|
CAPTION => $object->{Caption}, |
43
|
|
|
|
|
|
|
MANUFACTURER => $object->{Manufacturer}, |
44
|
|
|
|
|
|
|
DESCRIPTION => $object->{Description}, |
45
|
|
|
|
|
|
|
LAYOUT => $object->{Layout}, |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# avoid duplicates |
49
|
0
|
0
|
|
|
|
|
next if $seen->{$input->{NAME}}++; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$inventory->addEntry( |
52
|
|
|
|
|
|
|
section => 'INPUTS', |
53
|
|
|
|
|
|
|
entry => $input |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
58
|
|
|
|
|
|
|
class => 'Win32_PointingDevice', |
59
|
|
|
|
|
|
|
properties => [ qw/Name Caption Manufacturer Description PointingType DeviceInterface/ ] |
60
|
|
|
|
|
|
|
)) { |
61
|
0
|
|
|
|
|
|
my $input = { |
62
|
|
|
|
|
|
|
NAME => $object->{Name}, |
63
|
|
|
|
|
|
|
CAPTION => $object->{Caption}, |
64
|
|
|
|
|
|
|
MANUFACTURER => $object->{Manufacturer}, |
65
|
|
|
|
|
|
|
DESCRIPTION => $object->{Description}, |
66
|
|
|
|
|
|
|
POINTINGTYPE => $object->{PointingType}, |
67
|
|
|
|
|
|
|
INTERFACE => $mouseInterface{$object->{DeviceInterface}}, |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# avoid duplicates |
71
|
0
|
0
|
|
|
|
|
next if $seen->{$input->{NAME}}++; |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
$inventory->addEntry( |
74
|
|
|
|
|
|
|
section => 'INPUTS', |
75
|
|
|
|
|
|
|
entry => $input |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |