Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About xml prase #27

Open
stellalio opened this issue Jan 12, 2022 · 1 comment
Open

About xml prase #27

stellalio opened this issue Jan 12, 2022 · 1 comment

Comments

@stellalio
Copy link

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
Copy link
Collaborator

"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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants