-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WSTRING support for structures (#293)
* Add WSTRING support for dict_from-bytes * Add helper function to find null-terminator in WSTRING * Add test for find_wstring_null_terminator function * Use find_wstring_null_terminator function in adsSumRead * Add WSTRING support for size_of_structure * Fix size_of_structure. Broke it in the commit before by modifying the conditions. * Add WSTRING support for bytes_from_dict * Fix bytes_from_dict Array size was not calculated correctly * Use length of bytearray * Improve performance on adding remaining bytes This may not be necessary but replacing the for loop with the extend statement speeds speeds it up by factor 5 * Fix size_of_structure for multiple fields * Add test for read/write WSTRING struct * Add test for read/write WSTRING array struct * Add Changelog entry * Fix str_len - str_len now is always the number of characters without null-terminator - n_bytes is the number of bytes and differs for STRING or WSTRING * Add tests for size_of_structure for WSTRING * Add WSTRING to test_dict_from_bytes * Add WSTRING to test_bytes_from_dict * Fix WSTRING length for bytes_from_strings * Add comments * Remove redundant comment
- Loading branch information
Showing
7 changed files
with
316 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.