CC2420 Hardware and Software Acks
From TinyOS Documentation Wiki
Originally, the CC2420 radio stack only used hardware generated auto-acknowledgements provided by the CC2420 chip itself. This led to some issues, such as false acknowledgements where the radio chip would receive a packet and acknowledge its reception and the microcontroller would never actually receive the packet.
The current CC2420 stack uses software acknowledgements, which have a higher drop percentage. When used with the UniqueSend and UniqueReceive interfaces, dropped acknowledgements are more desirable than false acknowledgements. Received packets are always acknowledged before being filtered as a duplicate.
Use the PacketAcknowledgements or PacketLink interfaces to determine if a packet was successfully acknowledged.
Acknowledgment Controls
Defining the preprocessor variable CC2420_NO_ACKNOWLEDGEMENTS will disable all forms of acknowledgments at compile time.
Defining the preprocessor variable CC2420_HW_ACKNOWLEDGEMENTS will enable hardware acknowledgments and disable software acknowledgments.
Acknowledgments can also be toggled at run-time by accessing the CC2420Config interface provided by CC2420ControlC. Be sure to sync() the hardware if you reconfigure the CC2420 radio at runtime.
/**
* Sync must be called for acknowledgement changes to take effect
* @param enableAutoAck TRUE to enable auto acknowledgements
* @param hwAutoAck TRUE to default to hardware auto acks, FALSE to
* default to software auto acknowledgements
*/
command void CC2420Config.setAutoAck(bool enableAutoAck, bool hwAutoAck) {
atomic autoAckEnabled = enableAutoAck;
atomic hwAutoAckDefault = hwAutoAck;
}
/**
* @return TRUE if hardware auto acks are the default, FALSE if software
* acks are the default
*/
async command bool CC2420Config.isHwAutoAckDefault() {
atomic return hwAutoAckDefault;
}
/**
* @return TRUE if auto acks are enabled
*/
async command bool CC2420Config.isAutoAckEnabled() {
atomic return autoAckEnabled;
}
