From c553d447ce4381469a5da3b57a3d1e351b6870f3 Mon Sep 17 00:00:00 2001 From: liang_mike Date: Wed, 7 Jan 2009 04:12:39 +0000 Subject: [PATCH] Move the wiring for underlying AMSend/Receive/Snoop interfaces from CAMRadioC.nc/BlockingAM*C.nc to BlockingActiveMessageC.nc and from CAMSerialC.nc/BlockingSerialAM*C.nc to BlockingSerialActiveMessageC.nc. This prevents those interfaces from being wired multiple times in the case of multiple users. --- apps/tosthreads/apps/BaseStation/BaseStationAppC.nc | 8 -------- tos/lib/tosthreads/csystem/CAMRadioC.nc | 5 ----- tos/lib/tosthreads/csystem/CAMSerialC.nc | 4 ---- 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 +++-------- .../tosthreads/system/BlockingSerialAMReceiverC.nc | 2 -- tos/lib/tosthreads/system/BlockingSerialAMSenderC.nc | 2 -- .../tosthreads/system/BlockingSerialActiveMessageC.nc | 9 +++------ 10 files changed, 6 insertions(+), 41 deletions(-) diff --git a/apps/tosthreads/apps/BaseStation/BaseStationAppC.nc b/apps/tosthreads/apps/BaseStation/BaseStationAppC.nc index 46f26a53..a6d8832a 100644 --- a/apps/tosthreads/apps/BaseStation/BaseStationAppC.nc +++ b/apps/tosthreads/apps/BaseStation/BaseStationAppC.nc @@ -105,12 +105,4 @@ implementation SerialReceiveRadioSendP.SendAMPacket -> BlockingRadioActiveMessageC; SerialReceiveRadioSendP.BlockingReceiveAny -> BlockingSerialActiveMessageC.BlockingReceiveAny; SerialReceiveRadioSendP.BlockingAMSend -> BlockingRadioActiveMessageC; - - components ActiveMessageC, SerialActiveMessageC; - BlockingRadioActiveMessageC.Receive -> ActiveMessageC.Receive; - BlockingRadioActiveMessageC.Snoop -> ActiveMessageC.Snoop; - BlockingRadioActiveMessageC.AMSend -> ActiveMessageC.AMSend; - - BlockingSerialActiveMessageC.Receive -> SerialActiveMessageC.Receive; - BlockingSerialActiveMessageC.AMSend -> SerialActiveMessageC.AMSend; } diff --git a/tos/lib/tosthreads/csystem/CAMRadioC.nc b/tos/lib/tosthreads/csystem/CAMRadioC.nc index 8cb7f658..a066c05f 100644 --- a/tos/lib/tosthreads/csystem/CAMRadioC.nc +++ b/tos/lib/tosthreads/csystem/CAMRadioC.nc @@ -30,7 +30,6 @@ configuration CAMRadioC {} implementation { components CAMRadioP as CAMP; - components ActiveMessageC; components BlockingActiveMessageC as AM; CAMP.BlockingStdControl -> AM; @@ -42,8 +41,4 @@ implementation { CAMP.Packet -> AM; CAMP.AMPacket -> AM; CAMP.PacketAcknowledgements -> AM; - - AM.Receive -> ActiveMessageC.ReceiveDefault; - AM.Snoop -> ActiveMessageC.SnoopDefault; - AM.AMSend -> ActiveMessageC; } diff --git a/tos/lib/tosthreads/csystem/CAMSerialC.nc b/tos/lib/tosthreads/csystem/CAMSerialC.nc index ec6b299b..ac776aa4 100644 --- a/tos/lib/tosthreads/csystem/CAMSerialC.nc +++ b/tos/lib/tosthreads/csystem/CAMSerialC.nc @@ -30,7 +30,6 @@ configuration CAMSerialC {} implementation { components CAMSerialP as CAMP; - components SerialActiveMessageC; components BlockingSerialActiveMessageC as AM; CAMP.BlockingStdControl -> AM; @@ -40,7 +39,4 @@ implementation { CAMP.Packet -> AM; CAMP.AMPacket -> AM; CAMP.PacketAcknowledgements -> AM; - - AM.Receive -> SerialActiveMessageC.Receive; - AM.AMSend -> SerialActiveMessageC.AMSend; } diff --git a/tos/lib/tosthreads/system/BlockingAMReceiverC.nc b/tos/lib/tosthreads/system/BlockingAMReceiverC.nc index 0bbd0b7f..f3676010 100644 --- a/tos/lib/tosthreads/system/BlockingAMReceiverC.nc +++ b/tos/lib/tosthreads/system/BlockingAMReceiverC.nc @@ -44,10 +44,8 @@ generic configuration BlockingAMReceiverC(am_id_t amId) { } } implementation { - components ActiveMessageC; components BlockingActiveMessageC as AM; BlockingReceive = AM.BlockingReceive[amId]; - AM.Receive[amId] -> ActiveMessageC.ReceiveDefault[amId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingAMSenderC.nc b/tos/lib/tosthreads/system/BlockingAMSenderC.nc index 142a8d7e..4d70b1e0 100644 --- a/tos/lib/tosthreads/system/BlockingAMSenderC.nc +++ b/tos/lib/tosthreads/system/BlockingAMSenderC.nc @@ -45,10 +45,8 @@ 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 5564b534..3f90b911 100644 --- a/tos/lib/tosthreads/system/BlockingAMSnooperC.nc +++ b/tos/lib/tosthreads/system/BlockingAMSnooperC.nc @@ -44,10 +44,8 @@ generic configuration BlockingAMSnooperC(am_id_t amId) { } } implementation { - components ActiveMessageC; components BlockingActiveMessageC as AM; BlockingReceive = AM.BlockingSnoop[amId]; - AM.Snoop[amId] -> ActiveMessageC.SnoopDefault[amId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingActiveMessageC.nc b/tos/lib/tosthreads/system/BlockingActiveMessageC.nc index f749e1c9..f3ab2dcd 100644 --- a/tos/lib/tosthreads/system/BlockingActiveMessageC.nc +++ b/tos/lib/tosthreads/system/BlockingActiveMessageC.nc @@ -46,11 +46,6 @@ 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; @@ -66,9 +61,9 @@ implementation { BlockingAMSend = AMSenderP; BlockingStdControlC.SplitControl -> AM; - Receive = AMReceiverP.Receive; - Snoop = AMSnooperP.Snoop; - AMSend = AMSenderP.AMSend; + AMReceiverP.Receive -> AM.Receive; + AMSnooperP.Snoop -> AM.Snoop; + AMSenderP.AMSend -> AM.AMSend; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingSerialAMReceiverC.nc b/tos/lib/tosthreads/system/BlockingSerialAMReceiverC.nc index bbd89380..7ec4d389 100644 --- a/tos/lib/tosthreads/system/BlockingSerialAMReceiverC.nc +++ b/tos/lib/tosthreads/system/BlockingSerialAMReceiverC.nc @@ -43,10 +43,8 @@ generic configuration BlockingSerialAMReceiverC(am_id_t amId) { } } implementation { - components SerialActiveMessageC; components BlockingSerialActiveMessageC as AM; BlockingReceive = AM.BlockingReceive[amId]; - AM.Receive[amId] -> SerialActiveMessageC.Receive[amId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingSerialAMSenderC.nc b/tos/lib/tosthreads/system/BlockingSerialAMSenderC.nc index 66c9262c..b866dea1 100644 --- a/tos/lib/tosthreads/system/BlockingSerialAMSenderC.nc +++ b/tos/lib/tosthreads/system/BlockingSerialAMSenderC.nc @@ -45,10 +45,8 @@ generic configuration BlockingSerialAMSenderC(am_id_t AMId) { } implementation { - components SerialActiveMessageC; components BlockingSerialActiveMessageC as AM; BlockingAMSend = AM.BlockingAMSend[AMId]; - AM.AMSend[AMId] -> SerialActiveMessageC.AMSend[AMId]; Packet = AM; AMPacket = AM; diff --git a/tos/lib/tosthreads/system/BlockingSerialActiveMessageC.nc b/tos/lib/tosthreads/system/BlockingSerialActiveMessageC.nc index f9b9ed3d..82ef08db 100644 --- a/tos/lib/tosthreads/system/BlockingSerialActiveMessageC.nc +++ b/tos/lib/tosthreads/system/BlockingSerialActiveMessageC.nc @@ -44,24 +44,21 @@ configuration BlockingSerialActiveMessageC { interface AMPacket; interface PacketAcknowledgements; } - uses { - interface Receive as Receive[uint8_t id]; - interface AMSend as AMSend[uint8_t id]; - } } implementation { components SerialActiveMessageC as AM; components new BlockingStdControlC(); components BlockingSerialAMReceiverP as AMReceiverP; components BlockingSerialAMSenderP as AMSenderP; + BlockingStdControl = BlockingStdControlC; BlockingReceive = AMReceiverP; BlockingReceiveAny = AMReceiverP; BlockingAMSend = AMSenderP; BlockingStdControlC.SplitControl -> AM; - Receive = AMReceiverP.Receive; - AMSend = AMSenderP.AMSend; + AMReceiverP.Receive -> AM.Receive; + AMSenderP.AMSend -> AM.AMSend; Packet = AM; AMPacket = AM; -- 2.39.2