From e99ffc4e6f6188a8f9743a06695aecbfa439d576 Mon Sep 17 00:00:00 2001 From: gnawali Date: Mon, 24 Sep 2007 17:00:18 +0000 Subject: [PATCH] accommodate cc1000 and cc2420 platforms by wiring to platform specific active message, for rest use a dummy for now that always returns 1 for LinkPacketMetadata.highChannelQuality call --- tos/lib/net/ctp/CtpP.nc | 17 +++++++++++++---- tos/lib/net/ctp/CtpRoutingEngineP.nc | 1 - tos/lib/net/ctp/DummyActiveMessageP.nc | 12 ++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 tos/lib/net/ctp/DummyActiveMessageP.nc diff --git a/tos/lib/net/ctp/CtpP.nc b/tos/lib/net/ctp/CtpP.nc index b2aa76a7..ef3f4769 100644 --- a/tos/lib/net/ctp/CtpP.nc +++ b/tos/lib/net/ctp/CtpP.nc @@ -152,9 +152,6 @@ implementation { Router.CtpCongestion -> Forwarder; CtpInfo = Router; - components CC2420ActiveMessageC; - components CC2420PacketC as CC2420; - Router.CC2420Packet -> CC2420; components new TimerMilliC() as RetxmitTimer; Forwarder.RetxmitTimer -> RetxmitTimer; @@ -189,7 +186,19 @@ implementation { Estimator.SubReceive -> ReceiveControl; Estimator.SubPacket -> SendControl; Estimator.SubAMPacket -> SendControl; - Estimator.LinkPacketMetadata -> CC2420ActiveMessageC; + +#if defined(PLATFORM_TELOSB) || defined(PLATFORM_MICAZ) + components CC2420ActiveMessageC as PlatformActiveMessageC; +#elif defined (PLATFORM_MICA2) || defined (PLATFORM_MICA2DOT) + components CC1000ActiveMessageC as PlatformActiveMessageC; +#else + components DummyActiveMessageP as PlatformActiveMessageC; +#endif + + Estimator.LinkPacketMetadata -> PlatformActiveMessageC; + + // eventually // Estimator.LinkPacketMetadata -> ActiveMessageC; + MainC.SoftwareInit -> Estimator; } diff --git a/tos/lib/net/ctp/CtpRoutingEngineP.nc b/tos/lib/net/ctp/CtpRoutingEngineP.nc index 6c16ed9b..a2d935f8 100644 --- a/tos/lib/net/ctp/CtpRoutingEngineP.nc +++ b/tos/lib/net/ctp/CtpRoutingEngineP.nc @@ -115,7 +115,6 @@ generic module CtpRoutingEngineP(uint8_t routingTableSize, uint16_t minInterval, interface CtpCongestion; interface CompareBit; - interface CC2420Packet; } } diff --git a/tos/lib/net/ctp/DummyActiveMessageP.nc b/tos/lib/net/ctp/DummyActiveMessageP.nc new file mode 100644 index 00000000..e4cc0f98 --- /dev/null +++ b/tos/lib/net/ctp/DummyActiveMessageP.nc @@ -0,0 +1,12 @@ +module DummyActiveMessageP { + provides interface LinkPacketMetadata; +} + +implementation +{ + + async command bool LinkPacketMetadata.highChannelQuality(message_t* msg) { + return 1; + } + +} -- 2.39.2