Mitsubishi HC1500

From LinuxMCE
Revision as of 01:33, 20 June 2008 by Langstonius (Talk | contribs)

Jump to: navigation, search
This article is a stub and requires expansion


Controlling a Mitsubishi HC1500 Projector with RS232

Future home of HC1500 howto



Ruby Code

Section: 193 Off

log("Sending Off Command")
<$"00\x22\x0D"$>
sleep(2)
<$"00\x22\x0D"$>


Section: 192 On

log("Sending On Command")
<$"00\x21\x0D"$>
sleep(2)
<$"00\x21\x0D"$>


Section: 373 Prive Method Listing

#Written by Jason Bennett
def testMsg(msg)
 cmd = Command.new(device_.devid_, -1001, 1, 2, 48)
 if (msg =~ /00\x21/)
   cmd.params_[10] = "1"   #Device Turned on
   log("Telling DCE Projector is on")
 end
 if (msg =~ /00\x22/)
   cmd.params_[10] = "0"   #Device Turned off
   log("Telling DCE Projector is off")
 end
 SendCommand(cmd)
end
def recvMsg()
 reply = String.new
 while (true)
   buff = conn_.Recv(1, -1)
   if (buff.length() == 0)
     break
   end
   reply = reply + buff[-1].chr
 end
 log("New Message: #{reply}")
 return reply
end
def log(line)
 $log = File.open("/var/log/pluto/" + device_.devid_.to_s + "_Generic_Serial_Device.log", "a")
 $log.puts "(***):" + line.to_s
 $log.close
end


Section: 350 Process Incoming Data

#Written by Jason Bennett
msg = recvMsg()
testMsg(msg)
log("Message Caught: #{msg}")


Section: 355 Process Initialize

<$"00\x21\0D"$>