-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.class.php
209 lines (196 loc) · 6.07 KB
/
test.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
/* This test can be used against the test projector emulator */
/* http://pjlink.jbmia.or.jp/english/data_cl2/PJLink_5-2.zip */
require_once('pjlink.class.php');
$host = "127.0.0.1";
$password = "JBMIAProjectorLink";
$wait = 10;
$input = 22;
$pjlink = new PJLink();
$pjlink->setDevice($host, $password);
if (false === ($result = $pjlink->powerOn())) {
echo $pjlink->getError();
} else {
echo "Device is powered on<br />";
}
echo "Waiting $wait seconds...<br />";
flush();
sleep($wait);
if (false === ($result = $pjlink->getPowerState())) {
echo $pjlink->getError();
} else {
echo "Device power status: $result<br />";
}
if (false === ($class = $pjlink->getClass())) {
echo $pjlink->getError();
} else {
echo "Device class: $class<br />";
}
if (false === ($result = $pjlink->getInputList())) {
echo $pjlink->getError();
} else {
echo "Get input list: $result<br />";
}
if (false === ($result = $pjlink->setInput($input))) {
echo $pjlink->getError();
} else {
echo "Set input to $input: $result<br />";
}
if (false === ($result = $pjlink->getInput())) {
echo $pjlink->getError();
} else {
echo "Get input: $result<br />";
}
if (false === ($result = $pjlink->getOtherInfo())) {
echo $pjlink->getError();
} else {
echo "Other info: $result<br />";
}
if (false === ($result = $pjlink->getLampState())) {
echo $pjlink->getError();
} else {
echo "Lamp state: $result (".$pjlink->getResponseText().")<br />";
}
if (false === ($result = $pjlink->getManufactureName())) {
echo $pjlink->getError();
} else {
echo "Manufacture name: $result<br />";
}
if (false === ($result = $pjlink->getProductName())) {
echo $pjlink->getError();
} else {
echo "Product name: $result<br />";
}
if (false === ($result = $pjlink->getOtherInfo())) {
echo $pjlink->getError();
} else {
echo "Other info: $result<br />";
}
if (false === ($result = $pjlink->muteVideoAudioOff())) {
echo $pjlink->getError();
} else {
echo "Unmute Video and Audio: $result<br />";
}
if (false === ($result = $pjlink->muteVideoAudioOn())) {
echo $pjlink->getError();
} else {
echo "Mute Video and Audio: $result<br />";
}
if (false === ($result = $pjlink->muteVideoOff())) {
echo $pjlink->getError();
} else {
echo "Unmute Video: $result<br />";
}
if (false === ($result = $pjlink->muteVideoOn())) {
echo $pjlink->getError();
} else {
echo "Mute Video: $result<br />";
}
if (false === ($result = $pjlink->muteAudioOff())) {
echo $pjlink->getError();
} else {
echo "Unmute Audio: $result<br />";
}
if (false === ($result = $pjlink->muteAudioOn())) {
echo $pjlink->getError();
} else {
echo "Mute Audio: $result<br />";
}
if (false === ($result = $pjlink->getMuteState())) {
echo $pjlink->getError();
} else {
echo "Mute state: $result (".$pjlink->getResponseText().")<br />";
}
if ("2" == $class) {
if (false === ($result = $pjlink->getSerialNumber())) {
echo $pjlink->getError();
} else {
echo "Serial number: $result<br />";
}
if (false === ($result = $pjlink->getSoftwareVersion())) {
echo $pjlink->getError();
} else {
echo "Software version: $result<br />";
}
if (false === ($result = $pjlink->getInputTerminalName($input))) {
echo $pjlink->getError();
} else {
echo "Terminal name for input $input: $result<br />";
}
if (false === ($result = $pjlink->getInputResolution())) {
echo $pjlink->getError();
} else {
echo "Input resolution: $result<br />";
}
if (false === ($result = $pjlink->getRecommendedResolution())) {
echo $pjlink->getError();
} else {
echo "Recommended resolution: $result<br />";
}
if (false === ($result = $pjlink->getFilterUsage())) {
echo $pjlink->getError();
} else {
echo "Filter usage: $result<br />";
}
if (false === ($result = $pjlink->getLampReplacementModel())) {
echo $pjlink->getError();
} else {
echo "Lamp replacement Model: $result<br />";
}
if (false === ($result = $pjlink->getFilterReplacementModel())) {
echo $pjlink->getError();
} else {
echo "Filter replacement Model: $result<br />";
}
if (false === ($result = $pjlink->setSpeakerVolume(1))) {
echo $pjlink->getError();
} else {
echo "Set speaker volume +1: $result<br />";
}
if (false === ($result = $pjlink->setSpeakerVolume(1))) {
echo $pjlink->getError();
} else {
echo "Set speaker volume +1: $result<br />";
}
if (false === ($result = $pjlink->setSpeakerVolume(0))) {
echo $pjlink->getError();
} else {
echo "Set speaker volume -1: $result<br />";
}
if (false === ($result = $pjlink->setMicrophoneVolume(1))) {
echo $pjlink->getError();
} else {
echo "Set microphone volume +1: $result<br />";
}
if (false === ($result = $pjlink->setMicrophoneVolume(1))) {
echo $pjlink->getError();
} else {
echo "Set microphone volume +1: $result<br />";
}
if (false === ($result = $pjlink->setMicrophoneVolume(0))) {
echo $pjlink->getError();
} else {
echo "Set microphone volume -1: $result<br />";
}
if (false === ($result = $pjlink->freezeOn())) {
echo $pjlink->getError();
} else {
echo "Freeze display: $result<br />";
}
if (false === ($result = $pjlink->getFreezeState())) {
echo $pjlink->getError();
} else {
echo "Freeze state: $result (".$pjlink->getResponseText().")<br />";
}
if (false === ($result = $pjlink->freezeOff())) {
echo $pjlink->getError();
} else {
echo "Unfreeze display: $result<br />";
}
}
if (false === ($result = $pjlink->powerOff())) {
echo $pjlink->getError();
} else {
echo "Device is powered off<br />";
}
?>