Skip to content

feat: add manufacturer-specific VIF 0xFF 00 for 'total' (L1+L2+L3) - #1

Open
ZeppelinsBot wants to merge 3 commits into
mainfrom
feat/vif-ff00-total
Open

feat: add manufacturer-specific VIF 0xFF 00 for 'total' (L1+L2+L3)#1
ZeppelinsBot wants to merge 3 commits into
mainfrom
feat/vif-ff00-total

Conversation

@ZeppelinsBot

Copy link
Copy Markdown
Owner

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.

- 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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant