From: mmaroti Date: Fri, 8 May 2009 16:44:15 +0000 (+0000) Subject: make the software ack timeout configurable X-Git-Tag: rc_6_tinyos_2_1_1~391 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=b77cf86e72ab6faa4283b14fc4d80fca179381bd make the software ack timeout configurable --- diff --git a/tos/chips/rf2xx/README b/tos/chips/rf2xx/README index a0a2de98..35b67070 100644 --- a/tos/chips/rf2xx/README +++ b/tos/chips/rf2xx/README @@ -66,3 +66,11 @@ RADIO_ALARM_MILLI_EXP: 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. diff --git a/tos/chips/rf2xx/rf212/RF212ActiveMessageP.nc b/tos/chips/rf2xx/rf212/RF212ActiveMessageP.nc index b641981c..f5a47923 100644 --- a/tos/chips/rf2xx/rf212/RF212ActiveMessageP.nc +++ b/tos/chips/rf2xx/rf212/RF212ActiveMessageP.nc @@ -118,9 +118,13 @@ implementation call IEEE154MessageLayer.createAckReply(data, ack); } +#ifndef SOFTWAREACK_TIMEOUT +#define SOFTWAREACK_TIMEOUT 1000 +#endif + 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() diff --git a/tos/chips/rf2xx/rf230/README b/tos/chips/rf2xx/rf230/README index 1caf787a..0f4054c5 100644 --- a/tos/chips/rf2xx/rf230/README +++ b/tos/chips/rf2xx/rf230/README @@ -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. - diff --git a/tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc b/tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc index 0b07d1eb..301a110a 100644 --- a/tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc +++ b/tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc @@ -118,9 +118,13 @@ implementation call IEEE154MessageLayer.createAckReply(data, ack); } +#ifndef SOFTWAREACK_TIMEOUT +#define SOFTWAREACK_TIMEOUT 1000 +#endif + 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() diff --git a/tos/platforms/iris/chips/rf230/RadioConfig.h b/tos/platforms/iris/chips/rf230/RadioConfig.h index f3896a0f..106b2b55 100644 --- a/tos/platforms/iris/chips/rf230/RadioConfig.h +++ b/tos/platforms/iris/chips/rf230/RadioConfig.h @@ -59,6 +59,11 @@ enum #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