]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
IRIS support
authormmaroti <mmaroti>
Wed, 18 Jun 2008 17:31:27 +0000 (17:31 +0000)
committermmaroti <mmaroti>
Wed, 18 Jun 2008 17:31:27 +0000 (17:31 +0000)
apps/tutorials/RssiDemo/RssiBase/Makefile
apps/tutorials/RssiDemo/RssiBase/RssiBaseAppC.nc
apps/tutorials/RssiDemo/RssiBase/RssiBaseC.nc

index cd63ce143738b2ba99ee9454fb539bd70754b313..d2f93f6b9d2fb0d32f9bc175c1975e0723c1faf0 100644 (file)
@@ -5,5 +5,8 @@ INCLUDES= -I..               \
 
 CFLAGS += $(INCLUDES)
 
-include $(MAKERULES)
+ifneq ($(filter iris,$(MAKECMDGOALS)),) 
+       CFLAGS += -DRF230_RSSI_ENERGY
+endif
 
+include $(MAKERULES)
index bfb17e178932f4539c89f7150a8a2fc0e56ec788..ec116224ccf31eb32b78ef692b13984297531a62 100644 (file)
@@ -44,7 +44,10 @@ configuration RssiBaseAppC {
 #ifdef __CC2420_H__
   components CC2420ActiveMessageC;
   App -> CC2420ActiveMessageC.CC2420Packet;
-#endif //__CC2420_H__
+#elif  defined(PLATFORM_IRIS)
+  components  RF230ActiveMessageC;
+  App -> RF230ActiveMessageC.PacketRSSI;
+#endif
   
   App-> BaseStationC.RadioIntercept[AM_RSSIMSG];
 }
index 092a9a9050b4bfccd2077572ec74d48eb1a74362..650684aa48a3a5f54e510f9a1ea5037a8a410275 100644 (file)
@@ -41,7 +41,9 @@ module RssiBaseC {
 
 #ifdef __CC2420_H__
   uses interface CC2420Packet;
-#endif //__CC2420_H__  
+#else
+  uses interface PacketField<uint8_t> as PacketRSSI;
+#endif 
 } implementation {
 
   uint16_t getRssi(message_t *msg);
@@ -64,10 +66,15 @@ module RssiBaseC {
     cc1000_metadata_t *md =(cc1000_metadata_t*) msg->metadata;
     return md->strength_or_preamble;
   }
+#elif defined(PLATFORM_IRIS)
+  uint16_t getRssi(message_t *msg){
+    if(call PacketRSSI.isSet(msg))
+      return (uint16_t) call PacketRSSI.get(msg);
+    else
+      return 0xFFFF;
+  }
 #else
   #error Radio chip not supported! This demo currently works only \
-         for motes with CC1000 or CC2420 radios.  
-#endif //__CC2420_H__
-  
+         for motes with CC1000, CC2420 or RF230 radios.  
+#endif
 }
-