Created
August 31, 2012 00:49
-
-
Save also/3546825 to your computer and use it in GitHub Desktop.
Control Onkyo Receivers via ISCP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
s = TCPSocket.new ARGV[0], 60128 | |
def hexify_command(cmd) | |
cmd = '!1' + cmd unless cmd.start_with? '!1' | |
"ISCP\x00\x00\x00\x10\x00\x00\x00#{(cmd.length + 1).chr}\x01\x00\x00\x00#{cmd}\x0D" | |
end | |
s.write hexify_command(ARGV[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment