]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/rf212/RF212RadioP.nc
tune the LPL constants (use 5 ms listen check)
[tinyos-2.x.git] / tos / chips / rf2xx / rf212 / RF212RadioP.nc
index 14f32949e41972f09e09a622f2ee093b2958412e..81fc60b2e806c2735ade8547ff3bd77454066d76 100644 (file)
@@ -118,7 +118,7 @@ implementation
        }
 
 #ifndef SOFTWAREACK_TIMEOUT
-#define SOFTWAREACK_TIMEOUT    1000
+#define SOFTWAREACK_TIMEOUT    20000
 #endif
 
        async command uint16_t SoftwareAckConfig.getAckTimeout()
@@ -246,6 +246,8 @@ implementation
         * congestion backoff = 0x7 * CC2420_BACKOFF_PERIOD = 70 jiffies = 2240 microsec
         */
 
+#ifndef LOW_POWER_LISTENING
+
        async command uint16_t RandomCollisionConfig.getMinimumBackoff()
        {
                return (uint16_t)(320 * RADIO_ALARM_MICROSEC);
@@ -261,6 +263,8 @@ implementation
                return (uint16_t)(2240 * RADIO_ALARM_MICROSEC);
        }
 
+#endif
+
        async command uint16_t RandomCollisionConfig.getTransmitBarrier(message_t* msg)
        {
                uint16_t time;
@@ -320,11 +324,36 @@ implementation
 
 #ifdef LOW_POWER_LISTENING
 
-       async command bool LowPowerListeningConfig.getAckRequired(message_t* msg)
+       command bool LowPowerListeningConfig.needsAutoAckRequest(message_t* msg)
+       {
+               return call Ieee154PacketLayer.getDestAddr(msg) != TOS_BCAST_ADDR;
+       }
+
+       command bool LowPowerListeningConfig.ackRequested(message_t* msg)
        {
                return call Ieee154PacketLayer.getAckRequired(msg);
        }
 
+       command uint16_t LowPowerListeningConfig.getListenLength()
+       {
+               return 5;
+       }
+
+       async command uint16_t RandomCollisionConfig.getMinimumBackoff()
+       {
+               return (uint16_t)(320 * RADIO_ALARM_MICROSEC);
+       }
+
+       async command uint16_t RandomCollisionConfig.getInitialBackoff(message_t* msg)
+       {
+               return (uint16_t)(1600 * RADIO_ALARM_MICROSEC);
+       }
+
+       async command uint16_t RandomCollisionConfig.getCongestionBackoff(message_t* msg)
+       {
+               return (uint16_t)(3200 * RADIO_ALARM_MICROSEC);
+       }
+
 #endif
 
 }