This no_std
crate contains types for reading and writing DTBs. Here is a
code showing how to read a DTB-file:
```rust let mut buf = Vec::new(); let mut file = File::open("example.dtb").unwrap(); file.readtoend(&mut buf).unwrap(); let reader = Reader::read(buf.as_slice()).unwrap();
for entry in reader.reservedmementries() { println!("reserved: {:?}, {:?}", entry.address, entry.size); }
let root = reader.structitems(); let (prop, _) = root.pathstructitems("/node/property").next().unwrap(); println!("property: {:?}, {:?}", prop.name(), prop.valuestr());
let (node, nodeiter) = root.pathstructitems("/node/node2").next().unwrap(); println!("node: {:?}@{:?}", node.nodename(), node.unit_address());
let mut buf = [0; 32];
let (prop, ) = nodeiter.pathstructitems("property").next().unwrap(); println!( "property: {:?}, {:?}", prop.name(), prop.valuestrlist(&mut buf) );
let (prop, ) = nodeiter.pathstructitems("property2").next().unwrap(); println!( "property: {:?}, {:?}", prop.name(), prop.valueu32list(&mut buf) ); ```