]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
- commit necessary prerequisites for rf230 platform support
authorsdhsdh <sdhsdh>
Wed, 16 Sep 2009 00:57:20 +0000 (00:57 +0000)
committersdhsdh <sdhsdh>
Wed, 16 Sep 2009 00:57:20 +0000 (00:57 +0000)
support/make/blip.extra
tos/lib/net/blip/IPDispatchC.nc
tos/lib/net/blip/IPDispatchP.nc
tos/lib/net/blip/ReadLqiC.nc [new file with mode: 0644]
tos/lib/net/blip/interfaces/ReadLqi.nc [new file with mode: 0644]
tos/lib/net/blip/platform/CC2420ReadLqiC.nc [new file with mode: 0644]
tos/lib/net/blip/platform/RF230ReadLqiC.nc [new file with mode: 0644]

index ae486254982d9255a5ea03ac455970a135cee8ce..741cb6e39d66dcee204ba44b0e7b6febf51e09ff 100644 (file)
@@ -18,6 +18,7 @@ PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/interfaces/
 PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/nwprog/
 PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/shell/
 PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/serial/
+PFLAGS+=-I$(LOWPAN_ROOT)/tos/lib/net/blip/platform/
 
 PFLAGS+=$(LOWPAN_ROOT)/support/sdk/c/blip/lib6lowpan/lib6lowpan.c 
 PFLAGS+=$(LOWPAN_ROOT)/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c
index 407aca655fc64673ccff4d9611a9ebfe658912b2..a90b7ed1f2489f52d5cf52fc95e8de60b8faf26b 100644 (file)
@@ -39,7 +39,7 @@ configuration IPDispatchC {
   }
 } implementation {
   
-  components Ieee154MessageC as MessageC, ResourceSendP;
+  components Ieee154MessageC as MessageC
   components MainC, IPDispatchP, IPAddressC, IPRoutingP; 
   components NoLedsC as LedsC;
   components RandomC;
@@ -50,6 +50,7 @@ configuration IPDispatchC {
 
   IPDispatchP.Boot -> MainC;
 
+  components ResourceSendP;
   ResourceSendP.SubSend -> MessageC;
   ResourceSendP.Resource -> MessageC.SendResource[unique(IEEE154_SEND_CLIENT)];
   IPDispatchP.Ieee154Send -> ResourceSendP.Ieee154Send;
@@ -60,11 +61,10 @@ configuration IPDispatchC {
   IPDispatchP.LowPowerListening -> MessageC;
 #endif
 
-  components CC2420PacketC;
-
+  components ReadLqiC;
   IPDispatchP.Ieee154Packet -> MessageC;
   IPDispatchP.PacketLink -> MessageC;
-  IPDispatchP.CC2420Packet -> CC2420PacketC;
+  IPDispatchP.ReadLqi -> ReadLqiC;
 
   IPDispatchP.Leds -> LedsC;
 
index a83eee85125b084c72cc9d7feb420c1d3bdd42e4..86556537e366d417ee3355849be356018f15abca 100644 (file)
@@ -102,7 +102,7 @@ module IPDispatchP {
     interface Boot;
     interface SplitControl as RadioControl;
 
-    interface CC2420Packet;
+    interface ReadLqi;
     interface Packet;
 
 #ifndef SIM
@@ -486,7 +486,7 @@ module IPDispatchP {
       //   - if not, dispatch from here.
 
       metadata.sender = call Ieee154Packet.source(msg);
-      metadata.lqi = call CC2420Packet.getLqi(msg);
+      metadata.lqi = call ReadLqi.read(msg);
 
       real_payload_length = ntohs(ip->plen);
       adjustPlen(ip, &u_info);
@@ -670,7 +670,7 @@ module IPDispatchP {
     BLIP_STATS_INCR(stats.rx_total);
 
     call IPRouting.reportReception(call Ieee154Packet.source(msg),
-                                   call CC2420Packet.getLqi(msg));
+                                   call ReadLqi.read(msg));
 
     lowmsg.headers = getHeaderBitmap(&lowmsg);
     if (lowmsg.headers == LOWPAN_NALP_PATTERN) {
diff --git a/tos/lib/net/blip/ReadLqiC.nc b/tos/lib/net/blip/ReadLqiC.nc
new file mode 100644 (file)
index 0000000..0e2d57e
--- /dev/null
@@ -0,0 +1,29 @@
+
+/*
+ * Different platforms have different ways of getting in touch with
+ * the LQI reading the radio provides.  This module wraps the
+ * different ways in platform-independent logic.
+ *
+ * 
+ * @author Stephen Dawson-Haggerty <stevedh@eecs.berkeley.edu>
+ */
+
+configuration ReadLqiC {
+  provides interface ReadLqi;
+} implementation {
+  
+#if defined(PLATFORM_MICAZ) || defined(PLATFORM_TELOSB)  || \
+    defined(PLATFORM_EPIC)  || defined(PLATFORM_SHIMMER)
+  // cc2420 platforms
+  components CC2420ReadLqiC, CC2420PacketC;
+  ReadLqi = CC2420ReadLqiC;
+  CC2420ReadLqiC.CC2420Packet -> CC2420PacketC;
+#elif defined(PLATFORM_IRIS) 
+  components RF230ReadLqiC, RF230Ieee154MessageC;
+  ReadLqi = RF230ReadLqiC;
+  RF230ReadLqiC.SubLqi -> RF230Ieee154MessageC.PacketLinkQuality;
+#else
+#error "No radio support is available for your platform"
+#endif
+
+}
diff --git a/tos/lib/net/blip/interfaces/ReadLqi.nc b/tos/lib/net/blip/interfaces/ReadLqi.nc
new file mode 100644 (file)
index 0000000..0d874f7
--- /dev/null
@@ -0,0 +1,4 @@
+
+interface ReadLqi {
+  command uint8_t read(message_t *msg);
+}
diff --git a/tos/lib/net/blip/platform/CC2420ReadLqiC.nc b/tos/lib/net/blip/platform/CC2420ReadLqiC.nc
new file mode 100644 (file)
index 0000000..da457ea
--- /dev/null
@@ -0,0 +1,9 @@
+
+module CC2420ReadLqiC {
+  provides interface ReadLqi;
+  uses interface CC2420Packet;
+} implementation {
+  command uint8_t ReadLqi.read(message_t *msg) {
+    return call CC2420Packet.getLqi(msg);
+  }
+}
diff --git a/tos/lib/net/blip/platform/RF230ReadLqiC.nc b/tos/lib/net/blip/platform/RF230ReadLqiC.nc
new file mode 100644 (file)
index 0000000..7a67903
--- /dev/null
@@ -0,0 +1,9 @@
+
+module RF230ReadLqiC {
+  provides interface ReadLqi;
+  uses interface PacketField<uint8_t> as SubLqi;
+} implementation {
+  command uint8_t ReadLqi.read(message_t *msg) {
+    return call SubLqi.get(msg);
+  }
+}