cmcgerty / Sofar2mqtt

A smart home interface for Sofar solar and battery inverters.
GNU General Public License v3.0
79 stars 45 forks source link

Bug in checkCRC() function #66

Open watts-on-root opened 9 months ago

watts-on-root commented 9 months ago

Hi,

I just noticed there is a bug in the checkCRC function. The last line should be: return (received_crc == calculated_crc); and not: return (received_crc = calculated_crc); Otherwise the function always returns true regardless of whether the CRC is correct or not.

Regards.