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

bit_static_value decoder function #124

Merged
merged 1 commit into from
May 25, 2022

Conversation

DigiH
Copy link
Member

@DigiH DigiH commented May 25, 2022

New "bit_static_value" decoder function

Implementation in SwitchBot devices, Xiaomi scales and CGH1 decoders.

Updated docs.

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

@DigiH DigiH requested a review from h2zero May 25, 2022 15:49
Copy link
Member

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

Minor nitpicks, looks good otherwise.

src/decoder.cpp Outdated Show resolved Hide resolved
src/decoder.cpp Outdated Show resolved Hide resolved
Initial Test with SwitchBot Bot, Xiaomi Scales and CGH1 decoder compression

Improved code reduction with @h2zero's suggestion

• condensed getBinaryData to its own function, it being called twice
• commented out the UPPER case condition, as all presented data should only be lower case
• commented out the static_value bool cast, as this doesn't seem to be necessary any longer
@DigiH DigiH force-pushed the static-bitwise-test branch from 6e99c18 to 4c32888 Compare May 25, 2022 18:35
@1technophile
Copy link
Member

This enables a good cleanup, thanks

@1technophile 1technophile merged commit b08a374 into theengs:development May 25, 2022
@DigiH DigiH deleted the static-bitwise-test branch May 25, 2022 23:08
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.

3 participants