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

CanParser: add avg freq check #852

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Jun 10, 2023

  • calc freq
  • check freq

can/common.h Outdated
uint64_t check_threshold;
uint64_t first_seen_nanos = 0;
uint64_t last_seen_nanos = 0;
uint64_t check_threshold = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to alive_threshold?

@adeebshihadeh
Copy link
Contributor

Can you rebase?

@@ -275,8 +284,8 @@ void CANParser::UpdateValid(uint64_t sec) {
}

const bool missing = state.last_seen_nanos == 0;
const bool timed_out = (sec - state.last_seen_nanos) > state.check_threshold;
if (state.check_threshold > 0 && (missing || timed_out)) {
const bool timed_out = (sec - state.last_seen_nanos) > state.alive_threshold;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure how to use avg_freq to do the checking here. @adeebshihadeh: any suggestions?

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

Successfully merging this pull request may close these issues.

None yet

2 participants