v1.1.0: scanning, secondary addressing, fixed frames, wireless M-Bus, CLI - #4
Merged
Conversation
An 0xFD-table record carried its raw VIFE code in Unit.Type, so error flags (FD 17) decoded with the same type as a volume record and MatchType(VIFVolume) matched it. Extension types now carry the same 0x100/0x200 offset as the unit table keys, with exported VIFExt constants for the common 0xFD codes. Also fixes the duration-of-tariff code that collided with currency credit inside the extension map.
| minPrimaryAddr, maxPrimaryAddr, addrSecondarySelect, addrBroadcastReply, | ||
| ) | ||
| } | ||
| return uint8(value), nil |
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.
This release turns the library from a decoder into a full toolkit for reading M-Bus meters.
Bus scanning and secondary addressing
Client.ScanPrimarywalks an address range with SND_NKE + REQ_UD2 and reports responders.Client.ScanSecondaryruns the standard wildcard search over the 8 BCD id digits, narrowing on collisions, and returns full secondary addresses (id, manufacturer, version, medium).Client.SelectSecondary/Client.ReadBySecondaryselect a meter by secondary address (CI 0x52 to 0xFD, nibble wildcards) and read it. Networks with more than a handful of meters run on secondary addressing, so this was the biggest gap.Fixed data response (CI 0x73)
Older meters answer with the fixed data structure instead of variable records.
LongFrame.Decodenow handles both: the two counters come back as ordinary records (counter 2 as storage 1, matching its at-the-fixed-date semantics), so the query API works unchanged. Invalid BCD setsValueErrper the existing contract.Wireless M-Bus: new
wmbuspackageDecode-only support for EN 13757-4 / OMS telegrams as receiver dongles deliver them:
ParseWithoutCRCfor dongles that strip CRCsDataRecordslook identicalVIF extension type namespace fix
An 0xFD-table record carried its raw VIFE code in
Unit.Type, so error flags (FD 17) decoded with the same type as a volume record andMatchType(VIFVolume)matched it. Extension types now carry a 0x100/0x200 offset, with exportedVIFExt*constants and a regression test against the WaterStar capture that exposed it.mbusctl
Full CLI over TCP and serial:
scan(primary range or secondary wildcard),read(primary or secondary address,-allfor multi-telegram meters),set-address, all with-jsonoutput per record. Errors to stderr, data to stdout, distinct exit codes.Docs
No breaking changes to the v1.0.0 API.