From 993e42e649f589f715a25238a431734b819bc219 Mon Sep 17 00:00:00 2001 From: klueska Date: Sun, 15 Jun 2008 17:26:00 +0000 Subject: [PATCH] Changes to allow other subsystems to wire to underlying ActiveMessages (Send, Receive,Snoop). Basically moves all explicit wiring out of BlockingActiveMessageC and into the generic components that get instantiated on an AMid by AMid basis --- tos/lib/tosthreads/system/BlockingAMReceiverC.nc | 2 ++ tos/lib/tosthreads/system/BlockingAMSenderC.nc | 2 ++ tos/lib/tosthreads/system/BlockingAMSnooperC.nc | 2 ++ tos/lib/tosthreads/system/BlockingActiveMessageC.nc | 11 ++++++++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tos/lib/tosthreads/system/BlockingAMReceiverC.nc b/tos/lib/tosthreads/system/BlockingAMReceiverC.nc index efac52cb..59435414 100644 --- a/tos/lib/tosthreads/system/BlockingAMReceiverC.nc +++ b/tos/lib/tosthreads/system/BlockingAMReceiverC.nc @@ -43,8 +43,10 @@ generic configuration BlockingAMReceiverC(am_id_t amId) { } } implementation { + components ActiveMessageC; components BlockingActiveMessageC as AM; BlockingReceive = AM.BlockingReceive[amId]; + AM.Receive[amId] -> ActiveMessageC.Receive[amId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingAMSenderC.nc b/tos/lib/tosthreads/system/BlockingAMSenderC.nc index 4d70b1e0..142a8d7e 100644 --- a/tos/lib/tosthreads/system/BlockingAMSenderC.nc +++ b/tos/lib/tosthreads/system/BlockingAMSenderC.nc @@ -45,8 +45,10 @@ generic configuration BlockingAMSenderC(am_id_t AMId) { } implementation { + components ActiveMessageC; components BlockingActiveMessageC as AM; BlockingAMSend = AM.BlockingAMSend[AMId]; + AM.AMSend[AMId] -> ActiveMessageC.AMSend[AMId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingAMSnooperC.nc b/tos/lib/tosthreads/system/BlockingAMSnooperC.nc index 962bcbe1..234ef2fc 100644 --- a/tos/lib/tosthreads/system/BlockingAMSnooperC.nc +++ b/tos/lib/tosthreads/system/BlockingAMSnooperC.nc @@ -43,8 +43,10 @@ generic configuration BlockingAMSnooperC(am_id_t amId) { } } implementation { + components ActiveMessageC; components BlockingActiveMessageC as AM; BlockingReceive = AM.BlockingSnoop[amId]; + AM.Snoop[amId] -> ActiveMessageC.Snoop[amId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingActiveMessageC.nc b/tos/lib/tosthreads/system/BlockingActiveMessageC.nc index f3ab2dcd..f749e1c9 100644 --- a/tos/lib/tosthreads/system/BlockingActiveMessageC.nc +++ b/tos/lib/tosthreads/system/BlockingActiveMessageC.nc @@ -46,6 +46,11 @@ configuration BlockingActiveMessageC { interface AMPacket; interface PacketAcknowledgements; } + uses { + interface Receive as Receive[uint8_t id]; + interface Receive as Snoop[uint8_t id]; + interface AMSend as AMSend[uint8_t id]; + } } implementation { components ActiveMessageC as AM; @@ -61,9 +66,9 @@ implementation { BlockingAMSend = AMSenderP; BlockingStdControlC.SplitControl -> AM; - AMReceiverP.Receive -> AM.Receive; - AMSnooperP.Snoop -> AM.Snoop; - AMSenderP.AMSend -> AM.AMSend; + Receive = AMReceiverP.Receive; + Snoop = AMSnooperP.Snoop; + AMSend = AMSenderP.AMSend; Packet = AM; AMPacket = AM; -- 2.39.2