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

Potential error after flushCan #54

Open
ndantam opened this issue Nov 1, 2013 · 0 comments
Open

Potential error after flushCan #54

ndantam opened this issue Nov 1, 2013 · 0 comments

Comments

@ndantam
Copy link
Member

ndantam commented Nov 1, 2013

It looks like the purpose of flushCan() is to discard any previously received messages before performing some queries with the JMCs. However, if we receive some extra CAN message during those queries, this will break.

Fortunately, decodeParamFrame() does some message validation to ensure that it has the proper IDs. However, rather than discard spurious messages, decodeParamFrame() prints an error and bails out.

I think the right behavior here is validate IDs for each received CAN frame, and discard that frame if the IDs don't match. Only if we do not receive a correct response from the JMC before some timeout should we abort (or maybe even retry). This would also make the flushCan() function unnecessary.

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

1 participant