When trying to disable address filtering by changing RADIO_PARAM_RX_MODE like below, cc2420 auto ack is not working and motes get duplicated packets.
radio_value_t radio_rx_mode;
NETSTACK_RADIO.get_value(RADIO_PARAM_RX_MODE, &radio_rx_mode);
radio_rx_mode &= ~RADIO_RX_MODE_ADDRESS_FILTER;
if(NETSTACK_RADIO.set_value(RADIO_PARAM_RX_MODE, radio_rx_mode) != RADIO_RESULT_OK) {
LOG_WARN("radio does not support setting RADIO_PARAM_RX_MODE\n");
}else{
LOG_INFO("turned of Address filtering.\n");
}
How to turn off just address filtering?
Your code is the correct way to disable the address recognition / filtering.
Regarding auto-ACK, the CC2420 datasheet says this:
If
MDMCTRL0.AUTOACK
is enabled, an acknowledge frame is transmitted for all incoming frames accepted by the address recognition with the acknowledge request flag set and a valid CRC. AUTOACK therefore does not make sense unless alsoADR_DECODE
andAUTOCRC
are enabled.
This means that if you have address filtering disabled, you need to send software ACK.