]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
define and use RADIO_SEND_RESOURCE
authormmaroti <mmaroti>
Mon, 28 Sep 2009 19:55:07 +0000 (19:55 +0000)
committermmaroti <mmaroti>
Mon, 28 Sep 2009 19:55:07 +0000 (19:55 +0000)
tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc
tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc
tos/chips/rf2xx/rf212/RF212RadioC.nc
tos/chips/rf2xx/rf230/RF230RadioC.nc
tos/lib/net/blip/IPDispatchC.nc
tos/types/message.h

index 05afc133e9eaed9052bf4c0fbe386aff10250c4c..62d063153cd7904ae11eabc79316f721bca40571 100644 (file)
@@ -78,7 +78,7 @@ configuration CC2420TinyosNetworkC {
 implementation {
 
   enum {
-    TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_RESOURCE"),
+    TINYOS_N_NETWORKS = uniqueCount(RADIO_SEND_RESOURCE),
   };
 
   components MainC;
index bdfaee95b8e5b50695cde2cdf8f33c75b76418bb..e96354f0b930016e14191deaf1d08927a499c7b4 100644 (file)
@@ -65,7 +65,7 @@ implementation {
 
   enum {
     OWNER_NONE = 0xff,
-    TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_RESOURCE"),
+    TINYOS_N_NETWORKS = uniqueCount(RADIO_SEND_RESOURCE),
   } state;
 
   norace uint8_t resource_owner = OWNER_NONE, next_owner;
index 23af7c98fcc038d8f47134f403a7cd2d49b79973..fda050c1a7bbd467a92e8b0a8a6d056c35e889b9 100644 (file)
@@ -108,7 +108,7 @@ implementation
 #ifndef IEEE154FRAMES_ENABLED
 #ifndef TFRAMES_ENABLED
        components new AutoResourceAcquireLayerC();
-       AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique("RADIO_SEND_RESOURCE")];
+       AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique(RADIO_SEND_RESOURCE)];
 #else
        components new DummyLayerC() as AutoResourceAcquireLayerC;
 #endif
@@ -118,7 +118,7 @@ implementation
 // -------- RadioSend Resource
 
 #ifndef TFRAMES_ENABLED
-       components new SimpleFcfsArbiterC("RADIO_SEND_RESOURCE") as SendResourceC;
+       components new SimpleFcfsArbiterC(RADIO_SEND_RESOURCE) as SendResourceC;
        SendResource = SendResourceC;
 
 // -------- Ieee154 Message
index 380664b868bd598588c63e600e5d9d8bc10fc9a9..55381be9cbe910dab066e3bd30d0d81b6627b54e 100644 (file)
@@ -108,7 +108,7 @@ implementation
 #ifndef IEEE154FRAMES_ENABLED
 #ifndef TFRAMES_ENABLED
        components new AutoResourceAcquireLayerC();
-       AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique("RADIO_SEND_RESOURCE")];
+       AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique(RADIO_SEND_RESOURCE)];
 #else
        components new DummyLayerC() as AutoResourceAcquireLayerC;
 #endif
@@ -118,7 +118,7 @@ implementation
 // -------- RadioSend Resource
 
 #ifndef TFRAMES_ENABLED
-       components new SimpleFcfsArbiterC("RADIO_SEND_RESOURCE") as SendResourceC;
+       components new SimpleFcfsArbiterC(RADIO_SEND_RESOURCE) as SendResourceC;
        SendResource = SendResourceC;
 
 // -------- Ieee154 Message
index ec7efc06ad693f3de34a598437d42b3074fd017f..6abcc5af2996408dea2dbf1118c6a550ceb90aeb 100644 (file)
@@ -55,7 +55,7 @@ configuration IPDispatchC {
 #else
   components ResourceSendP;
   ResourceSendP.SubSend -> MessageC;
-  ResourceSendP.Resource -> MessageC.SendResource[unique("RADIO_SEND_RESOURCE")];
+  ResourceSendP.Resource -> MessageC.SendResource[unique(RADIO_SEND_RESOURCE)];
   IPDispatchP.Ieee154Send -> ResourceSendP.Ieee154Send;
 #endif
 
index dc66c268e5985eb36e7ae870106b5fec41d0ed8f..69a0a4373101bf88966981af0542a5a3dd1b0764 100644 (file)
@@ -18,4 +18,11 @@ typedef nx_struct message_t {
   nx_uint8_t metadata[sizeof(message_metadata_t)];
 } message_t;
 
+/*
+ * This resource is used to arbitrate access between ActiveMessageC,
+ * Ieee154MessageC and possibly future MessageC components to the 
+ * underlying radio driver.
+ */
+#define RADIO_SEND_RESOURCE "RADIO_SEND_RESOURCE"
+
 #endif