]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/layers/LowPowerListeningLayerP.nc
automatically request acks for non-broadcast messages in LPL mode
[tinyos-2.x.git] / tos / chips / rf2xx / layers / LowPowerListeningLayerP.nc
index 3030f26b078b1828022a5aee646ac15a01abbc58..7efab6dc21311283ac63822f1cb1949b6f7cec5c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <RadioAssert.h>
 #include <LowPowerListeningLayer.h>
+#include <Lpl.h>
 
 module LowPowerListeningLayerP
 {
@@ -52,10 +53,6 @@ module LowPowerListeningLayerP
 
 implementation
 {
-#ifndef LPL_DEF_LOCAL_WAKEUP
-#define LPL_DEF_LOCAL_WAKEUP 0
-#endif
-
        enum
        {
                // minimum wakeup time to catch a transmission in milliseconds
@@ -293,6 +290,9 @@ implementation
                else
                        return EBUSY;
 
+               if( call Config.needsAutoAckRequest(msg) )
+                       call PacketAcknowledgements.requestAck(msg);
+
                txMsg = msg;
                txError = FAIL;
 
@@ -332,7 +332,7 @@ implementation
                if( error != SUCCESS
                        || call LowPowerListening.getRemoteWakeupInterval(msg) == 0
                        || state == SEND_SUBSEND_DONE_LAST
-                       || (call Config.getAckRequired(msg) && call PacketAcknowledgements.wasAcked(msg)) )
+                       || (call Config.ackRequested(msg) && call PacketAcknowledgements.wasAcked(msg)) )
                {
                        call Timer.stop();
                        state = SEND_DONE;