Add LZSS encoding/decoding for MKRNB 1500 SBU #551
Merged
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 provides the possibility to store a .lzss compressed binary in the SARA-R410M module and decode it back to a binary during the reboot by the SBU. The example
SBU_LoadLZSS.ino
allows to test it.The lzss library is provided under
/libraries/SBU/extras/SBUBoot
with a symlink to/libraries/SBU/examples/SBU_LoadLZSS
.First of all, the function
void lzss_init(uint32_t const sketch_start, bool LZSStoBIN)
must be called. There are 2 possibilities:The function
int lzss_encode(const char buf_in[], uint32_t size)
reads the incoming buffer (from BINARY.H), performs the lzss encoding by chunks of 512 bytes and writes the obtained characters into the Sara modem in a file called "UPDATE.BIN.LZSS".On the other hand, the function
void lzss_decode()
reads the encoded "UPDATE.BIN.LZSS", decodes it back to a binary stream and writes it into the flash.