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

Support selection of built-in decoders #145

Open
Entropy512 opened this issue Jun 27, 2024 · 3 comments
Open

Support selection of built-in decoders #145

Entropy512 opened this issue Jun 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Entropy512
Copy link

Current Situation

Currently, this project builds in all decoders unless MY_DEVICES is set - in which case only a single decoder that is hardcoded is selected.

This leads to inefficiencies for the case where MY_DEVICES is not set, or having to manually change the hardcoded decoder when it is set

Proposed Change

Allow users to select built-in decoders using a build-time define

Additional Context

No response

@Entropy512 Entropy512 added the enhancement New feature or request label Jun 27, 2024
@NorthernMan54
Copy link
Owner

I had tried unsuccessfully to find a way to do that easily with complier directives when doing the original development work. As the code needs a count of the number of devices to include. Do you have some thoughts on how to achieve that ?

@Entropy512
Copy link
Author

Entropy512 commented Jun 28, 2024

Yeah, as I was digging through, it looks like doing it directly with compiler directives won't work, however this might:

https://docs.platformio.org/en/latest//manifests/library-json/fields/build/extrascript.html

If I'm reading that correctly, it looks like you could effectively run a variation of your rtl_433 import/update script automatically at build time to generate the DECLs in rtl_433_devices.h and signalDecoder.cpp - Probably don't want to touch those files directly, but you could probably create header fragments that are #included at the appropriate location within each file.

Not sure how to handle the OOK vs FSK stuff in signalDecoder without tracking that in a different location than currently that is easier to read from a Python script, although technically someone shouldn't be including both OOK and FSK devices when doing this to begin with. I only did it in my mangling of the devices specified by MY_DEVICES to support laziness when switching between FSK fineoffset and OOK neptune_r900.

@NorthernMan54
Copy link
Owner

If you want to submit a pull request, we can look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants