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 support for Celsia CZC1 #2391

Merged
merged 2 commits into from
Mar 5, 2023
Merged

Add support for Celsia CZC1 #2391

merged 2 commits into from
Mar 5, 2023

Conversation

libanp
Copy link
Contributor

@libanp libanp commented Feb 21, 2023

Initial working code

@libanp
Copy link
Contributor Author

libanp commented Feb 21, 2023

Follows discussion at #2389

This decoder works, so I thought I'd start the PR with what I've got. Aside from whatever else comes up, there are two issues with it I'd appreciate direction for:

  • Are there better utility functions for converting the raw bits to symbols? I didn't have much luck finding them
  • My use of a 'type' json field doesn't fit with fields described in DATA_FORMAT.md, should I be using 'subtype' instead?

@zuckschwerdt
Copy link
Collaborator

Remove the "type" key you have. There is no need for that info, it's either packets with "heat" or empty packets.

I can rewrite the bit decoder later, basically I would use the fact that when aligned a byte will hold exactly 2 bits, i.e. it can only ever be 55, 5a, a5, aa. Otherwise using extract_bits_symbols() will also work https://github.com/merbanan/rtl_433/blob/master/include/util.h#L84

@libanp
Copy link
Contributor Author

libanp commented Feb 22, 2023

I've updated the code with the corrections. The decoder matches against byte values now, but I'm happy for the it to be rewritten :)

@zuckschwerdt
Copy link
Collaborator

Looks good. In the long term we might want to put the bits into a uint8_t[] instead of the (large) bitbuffer_t. But that's an optimization for later (e.g. manchester_decode() also needs that refactor some day).

@zuckschwerdt zuckschwerdt merged commit c949e07 into merbanan:master Mar 5, 2023
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this pull request Sep 29, 2023
Co-authored-by: Liban Hannan <liban.p@gmail.com>
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.

2 participants