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:
+17
-1
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user