[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/layers TimeSyncMessageLayerC.nc, 1.1, 1.2 TimeSyncMessageLayerP.nc, 1.1, 1.2
Miklos Maroti
mmaroti at users.sourceforge.net
Thu Apr 23 13:42:23 PDT 2009
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29458/layers
Modified Files:
TimeSyncMessageLayerC.nc TimeSyncMessageLayerP.nc
Log Message:
use the AMSenderC infrastructure for TimeSyncMessageC to avoid CTP send clashes
Index: TimeSyncMessageLayerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/TimeSyncMessageLayerC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeSyncMessageLayerC.nc 9 Apr 2009 21:26:39 -0000 1.1
--- TimeSyncMessageLayerC.nc 23 Apr 2009 20:42:20 -0000 1.2
***************
*** 46,52 ****
interface LocalTime<TRadio> as LocalTimeRadio;
interface PacketField<uint8_t> as PacketTimeSyncOffset;
-
- interface AMSend as SubSend[am_id_t id];
- interface Packet as SubPacket;
}
}
--- 46,49 ----
***************
*** 64,69 ****
TimeSyncPacketMilli = TimeSyncMessageLayerP;
! SubSend = TimeSyncMessageLayerP;
! SubPacket = TimeSyncMessageLayerP;
PacketTimeStampRadio = TimeSyncMessageLayerP;
--- 61,69 ----
TimeSyncPacketMilli = 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;
Index: TimeSyncMessageLayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/TimeSyncMessageLayerP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeSyncMessageLayerP.nc 9 Apr 2009 21:26:39 -0000 1.1
--- TimeSyncMessageLayerP.nc 23 Apr 2009 20:42:20 -0000 1.2
***************
*** 38,42 ****
uses
{
! interface AMSend as SubSend[uint8_t id];
interface Packet as SubPacket;
--- 38,43 ----
uses
{
! interface Send as SubSend;
! interface AMPacket;
interface Packet as SubPacket;
***************
*** 93,103 ****
call PacketTimeSyncOffset.set(msg, offsetof(message_t, data) + len);
! return call SubSend.send[id](addr, msg, len + sizeof(timesync_relative_t));
}
command error_t TimeSyncAMSendRadio.cancel[am_id_t id](message_t* msg)
{
! return call SubSend.cancel[id](msg);
}
--- 94,106 ----
call PacketTimeSyncOffset.set(msg, offsetof(message_t, data) + len);
+ call AMPacket.setDestination(msg, addr);
+ call AMPacket.setType(msg, id);
! return call SubSend.send(msg, len + sizeof(timesync_relative_t));
}
command error_t TimeSyncAMSendRadio.cancel[am_id_t id](message_t* msg)
{
! return call SubSend.cancel(msg);
}
***************
*** 108,117 ****
command uint8_t TimeSyncAMSendRadio.maxPayloadLength[am_id_t id]()
{
! return call SubSend.maxPayloadLength[id]() - sizeof(timesync_relative_t);
}
command void* TimeSyncAMSendRadio.getPayload[am_id_t id](message_t* msg, uint8_t len)
{
! return call SubSend.getPayload[id](msg, len + sizeof(timesync_relative_t));
}
--- 111,120 ----
command uint8_t TimeSyncAMSendRadio.maxPayloadLength[am_id_t id]()
{
! return call SubSend.maxPayloadLength() - sizeof(timesync_relative_t);
}
command void* TimeSyncAMSendRadio.getPayload[am_id_t id](message_t* msg, uint8_t len)
{
! return call SubSend.getPayload(msg, len + sizeof(timesync_relative_t));
}
***************
*** 147,152 ****
/*----------------- SubSend.sendDone -------------------*/
! event void SubSend.sendDone[am_id_t id](message_t* msg, error_t error)
{
signal TimeSyncAMSendRadio.sendDone[id](msg, error);
signal TimeSyncAMSendMilli.sendDone[id](msg, error);
--- 150,157 ----
/*----------------- SubSend.sendDone -------------------*/
! event void SubSend.sendDone(message_t* msg, error_t error)
{
+ am_id_t id = call AMPacket.type(msg);
+
signal TimeSyncAMSendRadio.sendDone[id](msg, error);
signal TimeSyncAMSendMilli.sendDone[id](msg, error);
More information about the Tinyos-2-commits
mailing list