From: mmaroti Date: Mon, 28 Sep 2009 19:55:07 +0000 (+0000) Subject: define and use RADIO_SEND_RESOURCE X-Git-Tag: rc_6_tinyos_2_1_1~215 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=53433f70ad274e33b197f35a8daaaa5d21c24ec6 define and use RADIO_SEND_RESOURCE --- diff --git a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc index 05afc133..62d06315 100644 --- a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc +++ b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc @@ -78,7 +78,7 @@ configuration CC2420TinyosNetworkC { implementation { enum { - TINYOS_N_NETWORKS = uniqueCount("RADIO_SEND_RESOURCE"), + TINYOS_N_NETWORKS = uniqueCount(RADIO_SEND_RESOURCE), }; components MainC; diff --git a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc index bdfaee95..e96354f0 100644 --- a/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc +++ b/tos/chips/cc2420/lowpan/CC2420TinyosNetworkP.nc @@ -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; diff --git a/tos/chips/rf2xx/rf212/RF212RadioC.nc b/tos/chips/rf2xx/rf212/RF212RadioC.nc index 23af7c98..fda050c1 100644 --- a/tos/chips/rf2xx/rf212/RF212RadioC.nc +++ b/tos/chips/rf2xx/rf212/RF212RadioC.nc @@ -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 diff --git a/tos/chips/rf2xx/rf230/RF230RadioC.nc b/tos/chips/rf2xx/rf230/RF230RadioC.nc index 380664b8..55381be9 100644 --- a/tos/chips/rf2xx/rf230/RF230RadioC.nc +++ b/tos/chips/rf2xx/rf230/RF230RadioC.nc @@ -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 diff --git a/tos/lib/net/blip/IPDispatchC.nc b/tos/lib/net/blip/IPDispatchC.nc index ec7efc06..6abcc5af 100644 --- a/tos/lib/net/blip/IPDispatchC.nc +++ b/tos/lib/net/blip/IPDispatchC.nc @@ -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 diff --git a/tos/types/message.h b/tos/types/message.h index dc66c268..69a0a437 100644 --- a/tos/types/message.h +++ b/tos/types/message.h @@ -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