Add access to RadioHead header #12
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.
The user may optionally set and receive the 4 byte RadioHead packet header.
I think this mimics the behavior of the Arduino implementation.
The default is to ignore the header as in the past.
On transmit, the user may provide a keyword argument: tx_header with a 4-tuple of bytes.
tx_header = (To,From,ID,Flags)
to set the outgoing header.
On receive, the user can request that the packet header be included at the beginning of the packet via a keyword argument: with_header.
If set to True, the header will be included as the first 4 bytes of the packet and the data payload begins at byte 4.
Also, the user may specify a keyword argument: rx_filter to reject any "non-broadcast" packets not addressed as specified. A "broadcast" message contains 0xff as the To address. Broadcast messages are always received.
If rx_filter is set to a value other than 0xff, then incoming packets with the To field not matching the rx_filter will be ignored unless the To field contains 0xff.
If rx_filter is set to 0xff then all packets are accepted.
Same implementation as for RFM69 adafruit/Adafruit_CircuitPython_RFM69#12
Tested on feather_m0_express with RFM9x_breakout and on Raspberry Pi 3B+ with RFM9x Featherwing