def GetProps(self, node, path): """Get all properties from a node. Args: node: Full path to node name to look in. Returns: A dictionary containing all the properties, indexed by node name. The entries are Prop objects. Raises: ValueError: if the node does not exist. """ offset = libfdt.fdt_path_offset(self._fdt, path) if offset < 0: libfdt.Raise(offset) props_dict = {} poffset = libfdt.fdt_first_property_offset(self._fdt, offset) while poffset >= 0: dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset) prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff), libfdt.Data(dprop)) props_dict[prop.name] = prop poffset = libfdt.fdt_next_property_offset(self._fdt, poffset) return props_dict
def GetProps(self, node): """Get all properties from a node. Args: node: Full path to node name to look in. Returns: A dictionary containing all the properties, indexed by node name. The entries are Prop objects. Raises: ValueError: if the node does not exist. """ props_dict = {} poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset) while poffset >= 0: p = self._fdt_obj.get_property_by_offset(poffset) prop = Prop(node, poffset, p.name, p.value) props_dict[prop.name] = prop poffset = libfdt.fdt_next_property_offset(self._fdt, poffset) return props_dict