I wonder if anyone can tell me what is wrong here?
I am trying to make a device which you can configure with the device id of an X10 or zwave module which will control the power to your AV rack (amps, TV, etc). The idea is that you connect audio and/or video pipes to it and the on/off code turns the power switch on/off.
The error I get is a bit confusing when the ruby code is run... "For obscure reasons could not handle the message <0xb57b4b90>"
Below is the code and the error message:
RCODE:
0:require 'Ruby_Generic_Serial_Device'
1:class Command < Ruby_Generic_Serial_Device::RubyCommandWrapper
2:end
3:class Device_128 < Ruby_Generic_Serial_Device::RubySerialWrapper
4:#### 192 ####################################################################
5:def cmd_192(pk_pipe, pk_device_pipes, cmd=nil)
6:@returnParamArray.clear
7:target = device_.devdata_[278]
8:priority = 1
9:type = 1
10:command = 192
11:log('Turning on device: ' + target.to_s)
12:cmd = Command.new(target, target, priority, type, command)
13:SendCommand(cmd)
14:return @returnParamArray
15:end
16:#### 193 ####################################################################
17:def cmd_193(pk_pipe, cmd=nil)
18:@returnParamArray.clear
19:target = device_.devdata_[278]
20:priority = 1
21:type = 1
22:command = 193
23:log('Turning off device: ' + target.to_s)
24:cmd = Command.new(target, target, priority, type, command)
25:SendCommand(cmd)
26:return @returnParamArray
27:end
28:#### PRIVATE METHODS ####################################################################
29: def log(line)
30: $log = File.open("/var/log/pluto/" + device_.devid_.to_s + "_Generic_Serial_Device.log", "a")
31: logTime = Time.now
32: timeStr = logTime.strftime("%d-%m-%Y %H:%M:%S ")
33: $log.puts timeStr + "(***):" + line.to_s
34: $log.close
35: end
36:#### START SETTERS ####################################################################
37:def initialize()
38:super
39:@returnParamArray=Array.new
40:end
41:#### END SETTERS ####################################################################
42:end
44:05 06/12/09 22:08:12.099 GSDMessageTranslator isCmdImplemented = true <0xb5fb5b90>
05 06/12/09 22:08:12.099 #### Pre-Process Queue = 1 <0xb5fb5b90>
05 06/12/09 22:08:12.102 GSDMessageTranslator isCmdImplemented = false <0xb5fb5b90>
05 06/12/09 22:08:12.123 GSDMessageTranslator isCmdImplemented = false <0xb5fb5b90>
05 06/12/09 22:08:12.123 #### Pre-Process Queue = 2 <0xb5fb5b90>
05 06/12/09 22:08:12.123 _QueueProc Pre - 192 : 0 <0xb77b8b90>
05 06/12/09 22:08:12.123 GSD-Sleep Pre 192 : 0 <0xb77b8b90>
05 06/12/09 22:08:12.123 Process Queue = 1 <0xb77b8b90>
05 06/12/09 22:08:12.132 GSDMessageTranslator isCmdImplemented = true <0xb5fb5b90>
05 06/12/09 22:08:12.132 #### Pre-Process Queue = 2 <0xb5fb5b90>
05 06/12/09 22:08:12.133 GSDMessageTranslator isCmdImplemented = false <0xb5fb5b90>
05 06/12/09 22:08:12.133 #### Pre-Process Queue = 3 <0xb5fb5b90>
05 06/12/09 22:08:12.136 Parameter: <0xb57b4b90>
05 06/12/09 22:08:12.136 Parameter: <0xb57b4b90>
12-06-2009 22:08:12 (***):Turning on device: 51
01 06/12/09 22:08:12.138 Error while calling method: Cannot call class method: cmd_192
error: No matching function for overloaded 'new_RubyCommandWrapper', line: 12
backtrace:
in: (eval): 12
from (eval):12:in `initialize'
from (eval):12:in `new'
from (eval):12:in `cmd_192'
<0xb57b4b90>
01 06/12/09 22:08:12.138 For obscure reasons could not handle the message <0xb57b4b90>
Thanks in advance,
Chris