From: Bruce W. <br...@mi...> - 2000-12-13 05:02:52
|
> I went in the possibility to run "&process_serial_data" > As far I can see in this case it works like this (correct me when > i'm not right): > -Serial command is send to the controller via serial_item.pm | > homevision.pm > -&process_serial_data checks if there is a response, if there is > not directly response data available a new check will be done in > the next loop. I just coded up this example that might help you get started: http://misterhouse/mh/lib/example_serial_item.pm It inherits from Serial_Item (and thus Generic_Item), so all the standard methods available to it. It overrides set, and adds a hook to check for incoming data. Rename this module to whatever you like (e.g. walter_item), do a change all from example_serial_item to walter_item, put it it in your code dir (or mh/lib), add these 2 parms: walter_item_module = walter_item walter_item_port = COM9 Then code a simple event like this: $test_example1 = new walter_item('string_on', ON); $test_example1 -> add ('string_off', OFF); set $test_example1 OFF if $New_Second and !($Second % 5); print "Example 1 data received: $state\n" if $state = state_now $test_example1; Bruce |