-
Couldn't load subscription status.
- Fork 9
Description
Adafruit_CircuitPython_RFM/adafruit_rfm/rfm_common.py
Lines 294 to 299 in 91b9767
| assert 0 < len(data) <= self.max_packet_length | |
| # pylint: enable=len-as-condition | |
| self.idle() # Stop receiving to clear FIFO and keep it clear. | |
| # Combine header and data to form payload | |
| if self.radiohead: | |
| payload = bytearray(4) |
In asyncio_send() we assert that the passed data arg is no larger than the chip's FIFO (252 bytes) but then when radiohead is enabled, we prepend 4 bytes to data potentially making it larger than 252 bytes. This behavior results in data not being sent via the radio when it is equal to self.max_packet_length and radio head is enabled.
It feels like we should assert max packet length is 248 when radiohead is enabled. Even with the comment detailing how self.max_packet_length is used on async_send() I think this would also be a helpful note above all the locations where self.max_packet_length is set.
Thoughts?