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 PR includes my Kaitai struct for the Viomi map, + some fixes I was able to figure out thanks to it.
The previous map implementation was expecting the segment outlines to be at an earlier offset, causing it to read garbage as the number of segments and eventually end up overflowing.
I was not able to figure out the mysterious chunk yet, but since all data seems to loosely stick to a TLV (tag-length-value) format, and since the tag seems to always be an 8 byte value, with the first 4 byte being always the same for maps generated by the same device, I just save these 4 bytes and then use them to scan for the next section.
Testing
Viomi owners, please test this and let me know if it works for you. If you still get no map or you see map parsing-related errors in the log, please:
debug
enableenableDebugCapability
.Script: