Enable CRC by default #63
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
implements issue #62 enable CRC by default for compatibility with Arduino (RadioHead)
This will have minimal impact on existing CircuitPython to CircuitPython communication because the CircuitPython library allows the "explicit" header setting to determine if the CRC is used. The radio uses an additional header to determine if the CRC is present. The RadioHead library has an extra check to verify that the transmitter and received have matching CRC state. In Circuit Python, even if one side has the CRC enabled and the other does not, the packets will be received. The internal header determines if the CRC is present. Exiting deployments that do not have the CRC enabled will still work as before.
Tested between a Raspberry Pi and umfeathers2 (CP to CP) and between a Raspberry Pi and an Arduino Uno (CP to Radiohead)
The changes to the examples were to remove the explicit enable of the CRC since it is done by default.
To disable the CRC either:
1)disable it when instantiating the device (add crc=False) to the kwarg list
2)change the setting via the enable_crc property (rfm9x.enable_crc=False)
I did not test each of the examples, the changes were the same in all examples modified.