linux-msm / qdl

BSD 3-Clause "New" or "Revised" License
196 stars 76 forks source link

About xml prase #27

Open stellalio opened 2 years ago

stellalio commented 2 years ago

Hi,andersson

When I use the tool to download for 9607 and 9655 device it occurs:[PROGRAM] errors while parsing program. So I think some unnecessary field parsing can make selective judgment.For example, program->sector_size = attr_as_unsigned(node, "SECTOR_SIZE_IN_BYTES", &errors); could replace with : if (!strcmp((char *)node->properties->name, "SECTOR_SIZE_IN_BYTES")) { program->sector_size = attr_as_unsigned(node, "SECTOR_SIZE_IN_BYTES", &errors); } If the device xml file doesn't have SECTOR_SIZE_IN_BYTES,it will not prase the field SECTOR_SIZE_IN_BYTES;if the xml have,it will prase then.About this change,I have test and it can be compatible with different devices to parse xml.

andersson commented 3 weeks ago

"start_sector", "file_sector_offset" and "num_partition_sectors" are expressed in units of "SECTOR_SIZE_IN_BYTES", so this would require that we define a default value that works in all cases where one isn't explicitly defined.