Open GoogleCodeExporter opened 8 years ago
Hi,
with a comment from Stefan Verkoyen i made a UGLY HACK to smatool.c. For now my
system runs fine without the Date Error.
You can find my code in my smatool clone janus44444-sma-bluetooth
I have added all inverter codes i have found so far, too. Next thing is a test
where i will remove some lines from sma.in.new to make smatool running a little
bit faster without asking so much for bluetooth signal strenght.
Janus
Original comment by janus44...@gmail.com
on 10 Jun 2012 at 12:25
I've been seeing this too - so I took a look at the code - there is a bug in
ConvertStreamtoTime().
if( stream[i] != 0xff ) //check if all ffs which is a null value
nullvalue = 0;
(*value) = (*value) + stream[i]*pow(256,i);
This clears nullvalue if the char is not 0xff. But it sets (*value) even if the
char *IS* 0xff.
I suspect the correct code should be:
if( stream[i] != 0xff ) { //check if all ffs which is a null value
nullvalue = 0;
(*value) = (*value) + stream[i]*pow(256,i);
}
Original comment by coli...@gmail.com
on 3 Nov 2012 at 2:11
regarding comment #2:
did you test that fix for yourself? Does not seem to fix anything for me.
as far as i understand the code, the original version seems more correct.
(we want the value to be copied unless *all* entries in stream are set to 0xff,
so it is done like that: always copy and if all were 0xff, set to zero again in
the end).
Original comment by ste...@gmx.de
on 13 Nov 2012 at 4:31
janus444444 clone seems to work fine so far - maybe you can give some insight
as to get this right upstream, janus?
Original comment by ste...@gmx.de
on 13 Nov 2012 at 4:56
Original issue reported on code.google.com by
ste...@gmx.de
on 1 Jun 2012 at 3:51Attachments: