]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/layers/TimeSyncMessageLayerC.nc
use the AMSenderC infrastructure for TimeSyncMessageC to avoid CTP send clashes
[tinyos-2.x.git] / tos / chips / rf2xx / layers / TimeSyncMessageLayerC.nc
index 808e0ab94b1846b58d0c8e6a42739840e8a8efe4..cadf90a0cc22419ea63c952b65bd0219c4bf0ccc 100644 (file)
@@ -45,9 +45,6 @@ configuration TimeSyncMessageLayerC
 
                interface LocalTime<TRadio> as LocalTimeRadio;
                interface PacketField<uint8_t> as PacketTimeSyncOffset;
-
-               interface AMSend as SubSend[am_id_t id];
-               interface Packet as SubPacket;
        }
 }
 
@@ -63,8 +60,11 @@ implementation
        TimeSyncAMSendMilli = TimeSyncMessageLayerP;
        TimeSyncPacketMilli = TimeSyncMessageLayerP;
 
-       SubSend = TimeSyncMessageLayerP;
-       SubPacket = TimeSyncMessageLayerP;
+       // Ok, we use the AMSenderC infrastructure to avoid concurrent send clashes
+       components AMQueueP, ActiveMessageC;
+       TimeSyncMessageLayerP.SubSend -> AMQueueP.Send[unique(UQ_AMQUEUE_SEND)];
+       TimeSyncMessageLayerP.AMPacket -> ActiveMessageC;
+       TimeSyncMessageLayerP.SubPacket -> ActiveMessageC;
 
        PacketTimeStampRadio = TimeSyncMessageLayerP;
        PacketTimeStampMilli = TimeSyncMessageLayerP;