]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
make the software ack timeout configurable
authormmaroti <mmaroti>
Fri, 8 May 2009 16:44:15 +0000 (16:44 +0000)
committermmaroti <mmaroti>
Fri, 8 May 2009 16:44:15 +0000 (16:44 +0000)
tos/chips/rf2xx/README
tos/chips/rf2xx/rf212/RF212ActiveMessageP.nc
tos/chips/rf2xx/rf230/README
tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc
tos/platforms/iris/chips/rf230/RadioConfig.h

index a0a2de989ebf828fc69f3968bb91797c6443e547..35b670702028922a89bfb0a4619e9fce379749fc 100644 (file)
@@ -66,3 +66,11 @@ RADIO_ALARM_MILLI_EXP:
 The base two logarithm of the number of radio alarm ticks per one 
 millisecond.
 
 The base two logarithm of the number of radio alarm ticks per one 
 millisecond.
 
+SOFTWAREACK_TIMEOUT:
+
+The number of microseconds the driver should wait for a software 
+acknowledgement on the sender side. If your SPI bus is slow, then it will 
+take more time to download and upload the message from/to the radio chip, 
+so you need to increase this wait period. For example, for IRIS->IRIS 
+communication 800 microsec is enough, but for IRIS->TELOS we need 1600 
+because the TELOS in software ack mode is slow to reply with an ack packet.
index b641981ced3c25ae5b626663f229b209424fd2ca..f5a47923ae3963a125867813d358a53b93b12a50 100644 (file)
@@ -118,9 +118,13 @@ implementation
                call IEEE154MessageLayer.createAckReply(data, ack);
        }
 
                call IEEE154MessageLayer.createAckReply(data, ack);
        }
 
+#ifndef SOFTWAREACK_TIMEOUT
+#define SOFTWAREACK_TIMEOUT    1000
+#endif
+
        async command uint16_t SoftwareAckConfig.getAckTimeout()
        {
        async command uint16_t SoftwareAckConfig.getAckTimeout()
        {
-               return (uint16_t)(800 * RADIO_ALARM_MICROSEC);
+               return (uint16_t)(SOFTWAREACK_TIMEOUT * RADIO_ALARM_MICROSEC);
        }
 
        tasklet_async command void SoftwareAckConfig.reportChannelError()
        }
 
        tasklet_async command void SoftwareAckConfig.reportChannelError()
index 1caf787ab75c3211a6e137976c2c96fb8d23c763..0f4054c58789a55ff11c6fb4ba0d46260c47a428 100644 (file)
@@ -46,4 +46,3 @@ RF230_RSSI_ENERGY:
 If you define this, then the content of the RF230_PHY_ED_LEVEL is queried 
 instead of the RSSI value for eahc incoming message. This value can be 
 obtained with the PacketRSSI interface.
 If you define this, then the content of the RF230_PHY_ED_LEVEL is queried 
 instead of the RSSI value for eahc incoming message. This value can be 
 obtained with the PacketRSSI interface.
-
index 0b07d1eb5948b8b40a74dd147344b750c8a7a7c7..301a110a818401f78afe19b0fb5516274b6dce17 100644 (file)
@@ -118,9 +118,13 @@ implementation
                call IEEE154MessageLayer.createAckReply(data, ack);
        }
 
                call IEEE154MessageLayer.createAckReply(data, ack);
        }
 
+#ifndef SOFTWAREACK_TIMEOUT
+#define SOFTWAREACK_TIMEOUT    1000
+#endif
+
        async command uint16_t SoftwareAckConfig.getAckTimeout()
        {
        async command uint16_t SoftwareAckConfig.getAckTimeout()
        {
-               return (uint16_t)(800 * RADIO_ALARM_MICROSEC);
+               return (uint16_t)(SOFTWAREACK_TIMEOUT * RADIO_ALARM_MICROSEC);
        }
 
        tasklet_async command void SoftwareAckConfig.reportChannelError()
        }
 
        tasklet_async command void SoftwareAckConfig.reportChannelError()
index f3896a0f882143c920d7f3e60431a06dc271647a..106b2b5561ed35324c29cbfdaa38f771a0b9581c 100644 (file)
@@ -59,6 +59,11 @@ enum
 #define RF230_DEF_CHANNEL      11
 #endif
 
 #define RF230_DEF_CHANNEL      11
 #endif
 
+/* The number of microseconds a sending IRIS mote will wait for an acknowledgement */
+#ifndef SOFTWAREACK_TIMEOUT
+#define SOFTWAREACK_TIMEOUT    800
+#endif
+
 /*
  * This is the command used to calculate the CRC for the RF230 chip. 
  * TODO: Check why the default crcByte implementation is in a different endianness
 /*
  * This is the command used to calculate the CRC for the RF230 chip. 
  * TODO: Check why the default crcByte implementation is in a different endianness