-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnkyo.module.php
More file actions
62 lines (59 loc) · 1.8 KB
/
Onkyo.module.php
File metadata and controls
62 lines (59 loc) · 1.8 KB
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
<?php
/**
* This class allows control of some Onkyo equipment (tested with TX-SR313) via HDMI CEC. It supposes that you have installed libcec and have access to the command cec-client.
*/
class Onkyo implements iModule {
private $commands = array(
'start' => '15:44:6D',
'start-on-vcr-dvr' => '15:44:6A:02',
'select-vcr-dvr' => '15:44:69:02',
'stop' => '15:44:6C'
//15:45 - At end of each button press command to prevent repeated keypresses
//15:44:01 - Up / Tuner Freq Up
//15:44:02 - Down / Tuner Freq Down
//15:44:03 - Left
//15:44:04 - Right
//15:44:0A - Setup Menu
//15:44:0D - Exit
//15:44:2B - Enter
//15:44:33 - Sound Field Toggle
//15:44:34 - Source Inputs Toggle
//15:44:35 - Audio & Video Information OSD
//15:44:41 - Volume Up
//15:44:42 - Volume Down
//15:44:43 - Mute Toggle
//15:44:65 - Mute
//15:44:66 - Un-Mute
//15:44:69:01 - BD/DVD select
//15:44:69:02 - VCR/DVR select
//15:44:69:03 - CBL/SAT select
//15:44:69:04 - GAME select
//15:44:69:05 - AUX select
//15:44:69:06 - TUNER select
//15:44:69:07 - TV/CD select
//15:44:69:08 - PORT select
//15:44:6A:01 - BD/DVD + power
//15:44:6A:02 - VCR/DVR + power
//15:44:6A:03 - CBL/SAT + power
//15:44:6A:04 - GAME + power
//15:44:6A:05 - AUX + power
//15:44:6A:06 - TUNER + power
//15:44:6A:07 - TV/CD + power
//15:44:6A:08 - PORT + power
//15:44:6B - Amp Power Toggle
//15:44:6C - Amp Off
//15:44:6D - Amp On
);
public function execute($command) {
if (!array_key_exists($command, $this->commands)) {
die("Unknown command " . $command);
}
$exec = "/bin/echo 'tx " . $this->commands[$command] . "' | /usr/local/bin/cec-client -s -d 1";
$result;
$return;
exec($exec, $result, $return);
print_r($exec);
print_r($result);
print_r($return);
}
}