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

Add auto-calibrating to most decoders #268

Merged
merged 14 commits into from
Jul 13, 2017
Merged

Conversation

crankyoldgit
Copy link
Owner

Highlights:

  • Define timings for protocols where possible, in terms of the greatest common factor.
    i.e. various times are expressed as a multiple of a common tick/period value.
  • Use the incoming header mark (& space) to adjust timings for the rest of a protocol's decode routine.
  • Phase in use of a common data decoding routine.
  • Adjust unit-tests to new timings when they have been redefined due to the 'tick' calculations.
  • Unit-test case for a out-of-skew NEC-like message from possibly odd sending device (Apple TV remote Inconsistent decoding for unknown. #264 )

This PR improves matching of messages from sources that are slightly askew from the standard.
In short, it tries to make the timings relative to itself, rather than rely solely on fixed values with a percentage variance.
This addresses a problem discovered in #264 where an Apple TV remote was producing a NEC-like message (fixed in a different PR) but had timings that should have had the NEC decoder work, but it wasn't because the 'space' values were slightly to large. (Out of spec range).
Given the existing code matches that odd example's headers, we can use that to determine that the device is a bit out of spec, and thus adjust to match the message's skew.

@crankyoldgit
Copy link
Owner Author

Friendly ping for reviewers.

Copy link
Collaborator

@markszabo markszabo left a comment

Choose a reason for hiding this comment

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

LGTM

@crankyoldgit crankyoldgit merged commit b4f4684 into master Jul 13, 2017
@crankyoldgit crankyoldgit deleted the auto-timing-correct branch July 14, 2017 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants