From 327ace966d6e087bdc24da77429af6cdbd708bf1 Mon Sep 17 00:00:00 2001 From: mmaroti Date: Wed, 30 Sep 2009 17:41:13 +0000 Subject: [PATCH] Expose the PacketTimeStamp interfaces in TimeSyncMessageC --- tos/chips/rf2xx/rf212/RF212RadioC.nc | 4 --- .../rf2xx/rf212/RF212TimeSyncMessageC.nc | 9 +++++-- tos/chips/rf2xx/rf230/RF230RadioC.nc | 4 --- .../rf2xx/rf230/RF230TimeSyncMessageC.nc | 9 +++++-- tos/platforms/iris/ActiveMessageC.nc | 2 ++ tos/platforms/iris/TimeSyncMessageC.nc | 27 +++++++++++-------- tos/platforms/iris/chips/rf230/RadioConfig.h | 7 +++++ 7 files changed, 39 insertions(+), 23 deletions(-) diff --git a/tos/chips/rf2xx/rf212/RF212RadioC.nc b/tos/chips/rf2xx/rf212/RF212RadioC.nc index fda050c1..90d1f1ab 100644 --- a/tos/chips/rf2xx/rf212/RF212RadioC.nc +++ b/tos/chips/rf2xx/rf212/RF212RadioC.nc @@ -23,10 +23,6 @@ #include -#ifndef TFRAMES_ENABLED -#define PACKET_LINK -#endif - configuration RF212RadioC { provides diff --git a/tos/chips/rf2xx/rf212/RF212TimeSyncMessageC.nc b/tos/chips/rf2xx/rf212/RF212TimeSyncMessageC.nc index 0047d32d..7d9ecd60 100644 --- a/tos/chips/rf2xx/rf212/RF212TimeSyncMessageC.nc +++ b/tos/chips/rf2xx/rf212/RF212TimeSyncMessageC.nc @@ -28,15 +28,17 @@ configuration RF212TimeSyncMessageC provides { interface SplitControl; + interface Receive[uint8_t id]; interface Receive as Snoop[am_id_t id]; - interface AMPacket; - interface Packet; + interface AMPacket; + interface PacketTimeStamp as PacketTimeStampRadio; interface TimeSyncAMSend as TimeSyncAMSendRadio[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketRadio; + interface PacketTimeStamp as PacketTimeStampMilli; interface TimeSyncAMSend as TimeSyncAMSendMilli[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketMilli; } @@ -52,8 +54,11 @@ implementation AMPacket = RF212ActiveMessageC; Packet = TimeSyncMessageLayerC; + PacketTimeStampRadio = RF212ActiveMessageC; TimeSyncAMSendRadio = TimeSyncMessageLayerC; TimeSyncPacketRadio = TimeSyncMessageLayerC; + + PacketTimeStampMilli = RF212ActiveMessageC; TimeSyncAMSendMilli = TimeSyncMessageLayerC; TimeSyncPacketMilli = TimeSyncMessageLayerC; diff --git a/tos/chips/rf2xx/rf230/RF230RadioC.nc b/tos/chips/rf2xx/rf230/RF230RadioC.nc index 55381be9..dbec5f5a 100644 --- a/tos/chips/rf2xx/rf230/RF230RadioC.nc +++ b/tos/chips/rf2xx/rf230/RF230RadioC.nc @@ -23,10 +23,6 @@ #include -#ifndef TFRAMES_ENABLED -#define PACKET_LINK -#endif - configuration RF230RadioC { provides diff --git a/tos/chips/rf2xx/rf230/RF230TimeSyncMessageC.nc b/tos/chips/rf2xx/rf230/RF230TimeSyncMessageC.nc index 2319aa08..b308d10c 100644 --- a/tos/chips/rf2xx/rf230/RF230TimeSyncMessageC.nc +++ b/tos/chips/rf2xx/rf230/RF230TimeSyncMessageC.nc @@ -28,15 +28,17 @@ configuration RF230TimeSyncMessageC provides { interface SplitControl; + interface Receive[uint8_t id]; interface Receive as Snoop[am_id_t id]; - interface AMPacket; - interface Packet; + interface AMPacket; + interface PacketTimeStamp as PacketTimeStampRadio; interface TimeSyncAMSend as TimeSyncAMSendRadio[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketRadio; + interface PacketTimeStamp as PacketTimeStampMilli; interface TimeSyncAMSend as TimeSyncAMSendMilli[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketMilli; } @@ -52,8 +54,11 @@ implementation AMPacket = RF230ActiveMessageC; Packet = TimeSyncMessageLayerC; + PacketTimeStampRadio = RF230ActiveMessageC; TimeSyncAMSendRadio = TimeSyncMessageLayerC; TimeSyncPacketRadio = TimeSyncMessageLayerC; + + PacketTimeStampMilli = RF230ActiveMessageC; TimeSyncAMSendMilli = TimeSyncMessageLayerC; TimeSyncPacketMilli = TimeSyncMessageLayerC; diff --git a/tos/platforms/iris/ActiveMessageC.nc b/tos/platforms/iris/ActiveMessageC.nc index a4c2ae77..e9582747 100644 --- a/tos/platforms/iris/ActiveMessageC.nc +++ b/tos/platforms/iris/ActiveMessageC.nc @@ -21,6 +21,8 @@ * Author: Miklos Maroti */ +#include + configuration ActiveMessageC { provides diff --git a/tos/platforms/iris/TimeSyncMessageC.nc b/tos/platforms/iris/TimeSyncMessageC.nc index e39b4929..6e955c0a 100644 --- a/tos/platforms/iris/TimeSyncMessageC.nc +++ b/tos/platforms/iris/TimeSyncMessageC.nc @@ -34,9 +34,11 @@ configuration TimeSyncMessageC interface Packet; interface AMPacket; + interface PacketTimeStamp as PacketTimeStampRadio; interface TimeSyncAMSend as TimeSyncAMSendRadio[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketRadio; + interface PacketTimeStamp as PacketTimeStampMilli; interface TimeSyncAMSend as TimeSyncAMSendMilli[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketMilli; } @@ -44,16 +46,19 @@ configuration TimeSyncMessageC implementation { - components RF230TimeSyncMessageC as MAC; + components RF230TimeSyncMessageC as MessageC; - SplitControl = MAC; - Receive = MAC.Receive; - Snoop = MAC.Snoop; - Packet = MAC; - AMPacket = MAC; - - TimeSyncAMSendRadio = MAC; - TimeSyncPacketRadio = MAC; - TimeSyncAMSendMilli = MAC; - TimeSyncPacketMilli = MAC; + SplitControl = MessageC; + Receive = MessageC.Receive; + Snoop = MessageC.Snoop; + Packet = MessageC; + AMPacket = MessageC; + + PacketTimeStampRadio = MessageC; + TimeSyncAMSendRadio = MessageC; + TimeSyncPacketRadio = MessageC; + + PacketTimeStampMilli = MessageC; + TimeSyncAMSendMilli = MessageC; + TimeSyncPacketMilli = MessageC; } diff --git a/tos/platforms/iris/chips/rf230/RadioConfig.h b/tos/platforms/iris/chips/rf230/RadioConfig.h index 106b2b55..42c7e2e3 100644 --- a/tos/platforms/iris/chips/rf230/RadioConfig.h +++ b/tos/platforms/iris/chips/rf230/RadioConfig.h @@ -89,4 +89,11 @@ typedef TOne TRadio; */ #define RADIO_ALARM_MILLI_EXP (5 + MICA_DIVIDE_ONE_FOR_32KHZ_LOG2) +/** + * Make PACKET_LINK automaticaly enabled for Ieee154MessageC + */ +#if !defined(TFRAMES_ENABLED) && !defined(PACKET_LINK) +#define PACKET_LINK +#endif + #endif//__RADIOCONFIG_H__ -- 2.39.2