*/
#ifndef SIM
-#include "CC2420.h"
#endif
#include "AM.h"
#include "Serial.h"
interface PacketLink;
interface LowPowerListening;
+
+#ifdef PLATFORM_IRIS
+ interface RadioChannel;
+#else
interface CC2420Config;
+#endif
interface Leds;
bool reflectToken = FALSE;
CHECK_NODE_ID msg;
dbg("base", "uartreceive len %i of 0x%x\n", len, call SerialAMPacket.destination(msg));
-#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)
+#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC))
WDTCTL = WDT_ARST_1000;
#endif
atomic
call PacketLink.setRetries(msg, 0);
}
#ifdef LPL_SLEEP_INTERVAL
- call LowPowerListening.setRxSleepInterval(msg, LPL_SLEEP_INTERVAL);
+ call LowPowerListening.setRemoteWakeupInterval(msg, LPL_SLEEP_INTERVAL);
#endif
dbg("base", "radio send to: 0x%x len: %i\n", addr, len);
if (call RadioSend.send(addr, msg, len) == SUCCESS)
uint8_t len) {
config_cmd_t *cmd;
uint8_t error = CONFIG_ERROR_OK;
-#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)
+#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC))
WDTCTL = WDT_ARST_1000;
#endif
case CONFIG_ECHO:
break;
case CONFIG_SET_PARM:
+#ifdef PLATFORM_IRIS
+ // we should check the return value, hope it works
+ call RadioChannel.setChannel(cmd->rf.channel);
+ call IPAddress.setShortAddr(cmd->rf.addr);
+#else
call CC2420Config.setChannel(cmd->rf.channel);
// IPAddress calls sync() for you, I think, so we'll put it second
call IPAddress.setShortAddr(cmd->rf.addr);
call CC2420Config.sync();
+#endif
radioRetries = cmd->retx.retries;
radioDelay = cmd->retx.delay;
break;
return msg;
}
-
+#ifdef PLATFORM_IRIS
+ event void RadioChannel.setChannelDone() { }
+#else
event void CC2420Config.syncDone(error_t error) {
-
}
+#endif
event void ConfigureSend.sendDone(message_t *msg, error_t error) {
echo_busy = FALSE;