feat: add manufacturer-specific VIF 0xFF 00 for 'total' (L1+L2+L3) - #1
Open
ZeppelinsBot wants to merge 3 commits into
Open
feat: add manufacturer-specific VIF 0xFF 00 for 'total' (L1+L2+L3)#1ZeppelinsBot wants to merge 3 commits into
ZeppelinsBot wants to merge 3 commits into
Conversation
- Fix charBuffer overflow: 'i <= len' → 'i < len', add null termination - Fix vifBuffer overflow: 'i <= customVIFlen' → 'i < customVIFlen', add null termination - Fix date array: uninitialized VLA → fixed 8-byte array with zero init - Add explicit null termination after strncpy calls
The existing loops use 'i <= N' which writes to index N (one past end). Buffer size was N, now N+1. No behavioral change — just prevents the out-of-bounds write from corrupting adjacent stack memory.
FF 00 indicates total value across all phases (L1+L2+L3). Without this case, FF 00 would cause parsing errors as the 0x00 byte was not consumed by the VIFE handler. Output name extension: '_total'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a meter sends a VIFE sequence containing (meaning total across all phases: L1+L2+L3), the byte was not handled by the VIFE switch statement. This caused the parser to read as a separate byte in the next loop iteration, potentially leading to decoding errors.
Solution
Added to the manufacturer-specific VIFE handler (0xFF/0xFC prefix). The output name extension is
_total, appended to the base VIF name (e.g., , ).Reference
Finder 7E series meters and other manufacturers use to indicate the sum of all phases.