From: Ian D. <gal...@bt...> - 2001-03-23 21:14:21
|
Hi Bruce 1) I added the 'defined' to the two lines as you suggested but still the '0' does not work. For testing I have two machines with a crossed serial cable. Anything I type in a terminal prog. shows on the MH print screen except the '0'. I have tried the serial port set to records and raw and the same thing happens. I also changed my code to: my $s_data; if (defined $s_data = said $serial_out){ this still produced the same error message as before ? 2) I have checked my mh_temp.saved.states file and can see no reference to $plant_talk at all. If I do 2 read_next in a row (without an mh restart), it still does not increment. (or 3 or 4 etc). I am using the code exactly as in the example code shipped with 2.45. It used to work fine, I'm fairly certain it is only since I upgraded that it stopped incrementing. If I have chance this weekend I'll try to read up on the 'defined' part of Perl. I get the gist of it i.e. "", '0', empty, undef returning a false condition but not to sure how to implement the defined statement. Thanks Ian ----- Original Message ----- From: "Bruce Winter" <br...@mi...> To: <mis...@li...> Sent: Friday, March 23, 2001 2:50 AM Subject: RE: [misterhouse-users] Serial i/p strange happenings > > Firstly many thanks for your help and quick response. The problem with the > > '0' not only applies to just a '0' but anything containing a zero e.g. > > > > if I send to the MH serial port:- > > > > '101CR/LF' all I see is '11' > > Oops ... looks like my problem. Try adding the defined to these 2 lines in > mh check_for_generic_serial_data: > > $Serial_Ports{$port_name}{data} .= $data if defined $data; > > if (defined $Serial_Ports{$port_name}{data} and > > I DID say it was a common error, even for those of us who should now better > :) > > > > > > I did try your modified code to see if it made any difference but > > I got the > > following error. > > > > Can't modify defined operator in scaler assignment at (eval 42) line 2219, > > near "$serial_out) " > > BEGIN not safe after errors--compilation aborted at (eval42) line 2584. > > > My mistake again. I think we need to change from this: > > if (defined my $data ...) > > to this: > > my $data; > if (defined $data ...) > > I think inline 'my' are only allowed if they are the first thing in the > test. > > > > Ok on the 'X' problem do not spend any time modifying it for me, I've > > re-coded my PIC's to work with 'WYZ' as a header but just thought I would > > mention it in case it showed up with someone else. > > Ok, talked me out of it. I did look at it a bit, but it looked like the > type of changes that could easily break sending of X10 data. > > Bruce > > > ________________________________________________________ > To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 > > |