This project has moved. For the latest updates, please go here.
1
Vote

Tool goes to broadcast and search inverter when 10.1.1.1-9 IPs used

description

Hi,

Spent quite some time to figure out a bug in the code :
    if (strlen(IP_Address) > 8) // len bigger than 0.0.0.0 or len of no string ==> use IP_Adress from config
    {
        sprintf(inverters[devcount]->IPAddress, "%s", IP_Address);
        if (quiet == 0) printf("Inverter IP address: %s from SBFspot.cfg\n", inverters[devcount]->IPAddress);
    }
            else    // use IP from broadcast-detection of inverter
    {
            sprintf(inverters[devcount]->IPAddress, "%d.%d.%d.%d", CommBuf[38], CommBuf[39], CommBuf[40], CommBuf[41]);
        if (quiet == 0) printf("Inverter IP address: %s found via broadcastidentification\n", inverters[devcount]->IPAddress);
    }

if (strlen(IP_Address) > 8) then if should use IP from config. But what if ip is 10.1.1.8 ? ;-) I guess it should be '>= 8 ' in the code . Or '>7'
br,
dmitry

comments

SBF wrote Jul 30 at 7:14 PM

Thanks for reporting this bug.
Maybe better just use strcmp()