adafruit / Adafruit_CircuitPython_RFM9x

CircuitPython module for the RFM95/6/7/8 LoRa wireless 433/915mhz packet radios.
MIT License
68 stars 45 forks source link

rfm9x.crc_error breaks rfm9x.receive() booleans #80

Closed DJDevon3 closed 2 years ago

DJDevon3 commented 2 years ago

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather ESP32S2 with ESP32S2

Setting rfm9x.crc_error boolean to True or False breaks all booleans in the receive() function.

rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ, agc=True, crc=True)
rfm9x.crc_error = True  # <---- offender

Then, any parameter in rfm9x.receive() using a boolean gets broken.

        packet = rfm9x.receive(keep_listening=True,
                               timeout=15,
                               with_header=True,
                               with_ack=True)

The problem with bool only exists while rfm9x.crc_error is set.

Traceback (most recent call last):
  File "code.py", line 15, in <module>
  File "receiver.py", line 101, in <module>
  File "adafruit_rfm9x.py", line 857, in receive
TypeError: 'bool' object is not callable

Remove rfm9x.crc_error = True and the error goes away. Doesn't matter if it's set to true or false. Am I just using this wrong or is this a bug?

DJDevon3 commented 2 years ago

Was attempting to use crc_error as a boolean instead of a function. This is my fault. Closing.