Added support for layered formats

+ Formats can include sub-formats of previously defined formats
+ This search is done post config building so any format in the global config can be used
+ Clippy + fmt
This commit is contained in:
2022-06-19 14:08:37 -06:00
parent f2cec4c89e
commit 3274386ccf
5 changed files with 147 additions and 35 deletions
+17 -1
View File
@@ -48,4 +48,20 @@ field_type = {type = "String", endianness = "BigEndian", max_len = 55}
# byte field
[[formats.fields]]
name = "bytes field"
field_type = {type = "Bytes", endianness = "BigEndian", max_len = 55}
field_type = {type = "Bytes", endianness = "BigEndian", max_len = 5}
# Example of layer formats
[[formats]]
name = "example_layer"
bit_flip = false
# Example sub-format
[[formats.fields]]
name = "example sub-format"
field_type = {type = "Format", format_name = "example"}
# UInt after subfield
[[formats.fields]]
name = "uint field"
print_type = {print = "Base", base=16}
field_type = {type = "UInt", bit_width = 16, endianness = "LittleEndian"}