Skip to content

Commit

Permalink
use FW or FWE to get the firmware version
Browse files Browse the repository at this point in the history
  • Loading branch information
SW-Niko committed Nov 19, 2024
1 parent 48c00d9 commit d78d2fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/VeDirectFrameHandler/VeDirectFrameHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,12 @@ void VeDirectFrameHandler<T>::processTextData(std::string const& name, std::stri
return;
}

// According "VE.Direct-Protocol-3.33.pdf" for "Phoenix Charger" and "Smart BuckBoost".
// But it seems also some MPPT deliver FWE.
// Some devices use "FWE" instead of "FW" for the firmware version.
// We just remove the last 2 digit (final or beta indication) and copy the FW number.
if (name == "FWE") {
_msgOut->printf("%s FWE ignored. We use FE to process the firmware version (value '%s')\r\n", _logId, value.c_str());
if ((value.length() - 2) <= sizeof(_tmpFrame.firmwareVer_FW)) {
strncpy(_tmpFrame.firmwareVer_FW, value.c_str(), value.length() - 2);
}
return;
}

Expand Down

0 comments on commit d78d2fa

Please sign in to comment.