diff --git a/adafruit_rfm9x.py b/adafruit_rfm9x.py index 6e223cb..5f42938 100644 --- a/adafruit_rfm9x.py +++ b/adafruit_rfm9x.py @@ -127,6 +127,7 @@ class RFM9x: - baudrate: Baud rate of the SPI connection, default is 10mhz but you might choose to lower to 1mhz if using long wires or a breadboard. - agc: Boolean to Enable/Disable Automatic Gain Control - Default=False (AGC off) + - crc: Boolean to Enable/Disable Cyclic Redundancy Check - Default=True (CRC Enabled) Remember this library makes a best effort at receiving packets with pure Python code. Trying to receive packets too quickly will result in lost data so limit yourself to simple scenarios of sending and receiving single @@ -230,7 +231,8 @@ def __init__( preamble_length=8, high_power=True, baudrate=5000000, - agc=False + agc=False, + crc=True ): self.high_power = high_power # Device support SPI mode 0 (polarity & phase = 0) up to a max of 10mhz. @@ -273,9 +275,10 @@ def __init__( self.signal_bandwidth = 125000 self.coding_rate = 5 self.spreading_factor = 7 - # Default to disable CRC checking on incoming packets. - self.enable_crc = False - # set AGC - Default = True + # Default to enable CRC checking on incoming packets. + self.enable_crc = crc + """CRC Enable state""" + # set AGC - Default = False self.auto_agc = agc """Automatic Gain Control state""" # Set transmit power to 13 dBm, a safe value any module supports. diff --git a/examples/rfm9x_node1.py b/examples/rfm9x_node1.py index 6107ac4..89d24c5 100644 --- a/examples/rfm9x_node1.py +++ b/examples/rfm9x_node1.py @@ -27,8 +27,6 @@ # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ) -# enable CRC checking -rfm9x.enable_crc = True # set node addresses rfm9x.node = 1 rfm9x.destination = 2 diff --git a/examples/rfm9x_node1_ack.py b/examples/rfm9x_node1_ack.py index 2e30a43..992e6db 100644 --- a/examples/rfm9x_node1_ack.py +++ b/examples/rfm9x_node1_ack.py @@ -27,8 +27,6 @@ # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ) -# enable CRC checking -rfm9x.enable_crc = True # set delay before sending ACK rfm9x.ack_delay = 0.1 # set node addresses diff --git a/examples/rfm9x_node1_bonnet.py b/examples/rfm9x_node1_bonnet.py index ef87c02..b0f9bbb 100644 --- a/examples/rfm9x_node1_bonnet.py +++ b/examples/rfm9x_node1_bonnet.py @@ -66,9 +66,6 @@ display.show() -# enable CRC checking -rfm9x.enable_crc = True - # set node addresses rfm9x.node = 1 rfm9x.destination = 2 diff --git a/examples/rfm9x_node2.py b/examples/rfm9x_node2.py index 9f6d589..f9f7b9a 100644 --- a/examples/rfm9x_node2.py +++ b/examples/rfm9x_node2.py @@ -24,8 +24,6 @@ # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ) -# enable CRC checking -rfm9x.enable_crc = True # set node addresses rfm9x.node = 2 rfm9x.destination = 1 diff --git a/examples/rfm9x_node2_ack.py b/examples/rfm9x_node2_ack.py index 827a872..17c8886 100644 --- a/examples/rfm9x_node2_ack.py +++ b/examples/rfm9x_node2_ack.py @@ -24,8 +24,6 @@ # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ) -# enable CRC checking -rfm9x.enable_crc = True # set delay before transmitting ACK (seconds) rfm9x.ack_delay = 0.1 # set node addresses