Commit fe00679
authored
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 comment1 parent 8d70d1a commit fe00679
File tree
7 files changed
+316
-77
lines changed- pyads
- tests
7 files changed
+316
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
262 | | - | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| |||
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| |||
319 | 326 | | |
320 | 327 | | |
321 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
322 | 337 | | |
323 | 338 | | |
324 | 339 | | |
| |||
392 | 407 | | |
393 | 408 | | |
394 | 409 | | |
395 | | - | |
| 410 | + | |
396 | 411 | | |
397 | 412 | | |
398 | | - | |
399 | | - | |
400 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
401 | 427 | | |
402 | 428 | | |
403 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
| 1008 | + | |
| 1009 | + | |
1013 | 1010 | | |
1014 | 1011 | | |
1015 | 1012 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments