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

Subindex parsing doesn't abide by standard, misses parsing arrays that have skipped subindices #445

Open
oren-hinkis opened this issue Sep 22, 2021 · 1 comment
Labels

Comments

@oren-hinkis
Copy link

oren-hinkis commented Sep 22, 2021

According to the standard, SubNumber indicates the total number of available objects in the array but doesn't indicate the highest subindex that is available. That is supposed to be give in the value of the sub0 object of that array.

image

However, the code uses the SubNumber as the variable to parse the array. This leads to issues in cases where a sub number is skipped in the EDS
read_integer(subs, *object, "SubNumber");
for(uint8_t i=0; i < subs; ++i){}

https://www.can-cia.org/can-knowledge/canopen/cia306/

@mathias-luedtke
Copy link
Member

Good point!

A fix should not be too hard: The code needs to iterate SubNumber times between 0 and sub0.

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

No branches or pull requests

2 participants