[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf230 DefaultMacC.nc,
1.3, 1.4 DefaultMacP.nc, 1.2, 1.3 DefaultPacket.h, 1.3,
1.4 DefaultPacketC.nc, 1.2, 1.3 DefaultPacketP.nc, 1.2,
1.3 PacketLastTouch.nc, 1.1, 1.2 RF230Config.nc, 1.2,
1.3 RF230LayerC.nc, 1.3, 1.4 RF230LayerP.nc, 1.4,
1.5 TimeSyncMessageC.nc, 1.1, 1.2 TimeSyncMessageP.nc, 1.2,
1.3 PacketTimeSynch.nc, 1.2, NONE
Miklos Maroti
mmaroti at users.sourceforge.net
Sat Mar 29 13:10:35 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7981/tos/chips/rf230
Modified Files:
DefaultMacC.nc DefaultMacP.nc DefaultPacket.h
DefaultPacketC.nc DefaultPacketP.nc PacketLastTouch.nc
RF230Config.nc RF230LayerC.nc RF230LayerP.nc
TimeSyncMessageC.nc TimeSyncMessageP.nc
Removed Files:
PacketTimeSynch.nc
Log Message:
fixing TimeSyncMessage for the IRIS
Index: DefaultMacC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/DefaultMacC.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultMacC.nc 12 Mar 2008 19:42:56 -0000 1.3
--- DefaultMacC.nc 29 Mar 2008 20:10:33 -0000 1.4
***************
*** 40,43 ****
--- 40,45 ----
interface PacketField<uint8_t> as PacketLinkQuality;
interface PacketTimeStamp<TRF230, uint16_t>;
+
+ interface PacketLastTouch;
}
}
***************
*** 61,64 ****
--- 63,69 ----
PacketTimeStamp = DefaultPacketC.PacketTimeStamp;
+ PacketLastTouch = DefaultPacketC;
+ RF230LayerC.lastTouch -> DefaultPacketC.lastTouch;
+
components ActiveMessageLayerC;
components MessageBufferLayerC;
Index: DefaultMacP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/DefaultMacP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DefaultMacP.nc 20 Feb 2008 01:01:48 -0000 1.2
--- DefaultMacP.nc 29 Mar 2008 20:10:33 -0000 1.3
***************
*** 296,299 ****
{
}
-
}
--- 296,298 ----
Index: DefaultPacket.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/DefaultPacket.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultPacket.h 27 Mar 2008 21:59:28 -0000 1.3
--- DefaultPacket.h 29 Mar 2008 20:10:33 -0000 1.4
***************
*** 44,49 ****
enum defpacket_metadata_flags
{
! DEFPACKET_WAS_ACKED = 0x01,
! DEFPACKET_TIMESTAMP = 0x02,
DEFPACKET_CLEAR_METADATA = 0x00,
--- 44,50 ----
enum defpacket_metadata_flags
{
! DEFPACKET_WAS_ACKED = 0x01, // PacketAcknowledgements
! DEFPACKET_TIMESTAMP = 0x02, // PacketTimeStamp
! DEFPACKET_LAST_TOUCH = 0x04, // PacketLastTouch.touch
DEFPACKET_CLEAR_METADATA = 0x00,
Index: DefaultPacketC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/DefaultPacketC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DefaultPacketC.nc 12 Mar 2008 19:42:56 -0000 1.2
--- DefaultPacketC.nc 29 Mar 2008 20:10:33 -0000 1.3
***************
*** 35,38 ****
--- 35,41 ----
interface PacketTimeStamp<TRF230, uint16_t>;
+ interface PacketLastTouch;
+
+ async event void lastTouch(message_t* msg);
}
}
***************
*** 49,52 ****
PacketLinkQuality = DefaultPacketP.PacketLinkQuality;
PacketTransmitPower = DefaultPacketP.PacketTransmitPower;
! PacketTimeStamp = DefaultPacketP.PacketTimeStamp;
}
--- 52,58 ----
PacketLinkQuality = DefaultPacketP.PacketLinkQuality;
PacketTransmitPower = DefaultPacketP.PacketTransmitPower;
! PacketTimeStamp = DefaultPacketP;
!
! PacketLastTouch = DefaultPacketP;
! lastTouch = DefaultPacketP;
}
Index: DefaultPacketP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/DefaultPacketP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DefaultPacketP.nc 12 Mar 2008 19:42:56 -0000 1.2
--- DefaultPacketP.nc 29 Mar 2008 20:10:33 -0000 1.3
***************
*** 34,37 ****
--- 34,40 ----
interface PacketTimeStamp<TRF230, uint16_t>;
+ interface PacketLastTouch;
+
+ async event void lastTouch(message_t* msg);
}
***************
*** 191,193 ****
--- 194,223 ----
transmitPower = value;
}
+
+ /*----------------- PacketLastTouch -----------------*/
+
+ async command void PacketLastTouch.request(message_t* msg)
+ {
+ getMeta(msg)->flags |= DEFPACKET_LAST_TOUCH;
+ }
+
+ async command void PacketLastTouch.cancel(message_t* msg)
+ {
+ getMeta(msg)->flags &= ~DEFPACKET_LAST_TOUCH;
+ }
+
+ async command bool PacketLastTouch.isPending(message_t* msg)
+ {
+ return getMeta(msg)->flags & DEFPACKET_LAST_TOUCH;
+ }
+
+ async event void lastTouch(message_t* msg)
+ {
+ if( getMeta(msg)->flags & DEFPACKET_LAST_TOUCH )
+ signal PacketLastTouch.touch(msg);
+ }
+
+ default async event void PacketLastTouch.touch(message_t* msg)
+ {
+ }
}
Index: PacketLastTouch.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/PacketLastTouch.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PacketLastTouch.nc 12 Mar 2008 19:42:56 -0000 1.1
--- PacketLastTouch.nc 29 Mar 2008 20:10:33 -0000 1.2
***************
*** 36,39 ****
--- 36,44 ----
/**
+ * Returns TRUE if the touch callback is already scheduled.
+ */
+ async command bool isPending(message_t* msg);
+
+ /**
* This event is called by the MAC layer when the tranmission of the
* message starts (the SFD byte is already transmitted and the packet
Index: RF230Config.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/RF230Config.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RF230Config.nc 20 Feb 2008 01:01:48 -0000 1.2
--- RF230Config.nc 29 Mar 2008 20:10:33 -0000 1.3
***************
*** 49,53 ****
* Gets the number of bytes we should read before the RadioReceive.header
* event is fired. If the length of the packet is less than this amount,
! * then that event is fired earlier.
*/
async command uint8_t getHeaderLength();
--- 49,55 ----
* Gets the number of bytes we should read before the RadioReceive.header
* event is fired. If the length of the packet is less than this amount,
! * then that event is fired earlier. The last touch event is not signaled
! * for packets whose length is less than or equal to this header length.
! * The header length must be at least 1.
*/
async command uint8_t getHeaderLength();
Index: RF230LayerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/RF230LayerC.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RF230LayerC.nc 12 Mar 2008 19:42:56 -0000 1.3
--- RF230LayerC.nc 29 Mar 2008 20:10:33 -0000 1.4
***************
*** 38,41 ****
--- 38,43 ----
interface PacketField<uint8_t> as PacketTransmitPower;
interface PacketTimeStamp<TRF230, uint16_t>;
+
+ async event void lastTouch(message_t* msg);
}
}
***************
*** 70,73 ****
--- 72,77 ----
RF230LayerP.BusyWait -> BusyWaitMicroC;
+ lastTouch = RF230LayerP.lastTouch;
+
#ifdef RF230_DEBUG
components DiagMsgC;
Index: RF230LayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/RF230LayerP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RF230LayerP.nc 12 Mar 2008 19:42:56 -0000 1.4
--- RF230LayerP.nc 29 Mar 2008 20:10:33 -0000 1.5
***************
*** 62,65 ****
--- 62,67 ----
interface RadioAlarm;
+ async event void lastTouch(message_t* msg);
+
#ifdef RF230_DEBUG
interface DiagMsg;
***************
*** 381,384 ****
--- 383,387 ----
uint8_t length;
uint8_t* data;
+ uint8_t header;
if( cmd != CMD_NONE || state != STATE_RX_ON || ! isSpiAcquired() || radioIrq )
***************
*** 428,434 ****
call HplRF230.spiSplitReadWrite(length);
! // the FCS is atomatically generated
length -= 2;
do {
call HplRF230.spiSplitReadWrite(*(data++));
--- 431,452 ----
call HplRF230.spiSplitReadWrite(length);
! // the FCS is atomatically generated (2 bytes)
length -= 2;
+ header = call RF230Config.getHeaderLength();
+ if( header > length )
+ header = length;
+
+ length -= header;
+
+ // first upload the header
+ do {
+ call HplRF230.spiSplitReadWrite(*(data++));
+ }
+ while( --header != 0 );
+
+ call PacketTimeStamp.set(msg, time);
+ signal lastTouch(msg);
+
do {
call HplRF230.spiSplitReadWrite(*(data++));
***************
*** 538,543 ****
length -= read;
! while( read-- != 0 )
crc = call HplRF230.crcByte(crc, *(data++) = call HplRF230.spiSplitReadWrite(0));
if( signal RadioReceive.header(rxMsg) )
--- 556,563 ----
length -= read;
! do {
crc = call HplRF230.crcByte(crc, *(data++) = call HplRF230.spiSplitReadWrite(0));
+ }
+ while( --read != 0 );
if( signal RadioReceive.header(rxMsg) )
Index: TimeSyncMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncMessageC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeSyncMessageC.nc 12 Mar 2008 19:42:56 -0000 1.1
--- TimeSyncMessageC.nc 29 Mar 2008 20:10:33 -0000 1.2
***************
*** 31,35 ****
interface TimeSyncSend<TMicro> as TimeSyncSendMicro[am_id_t id];
interface TimeSyncPacket<TMicro> as TimeSyncPacketMicro;
! interface LocalTime<TMicro> as LocalTimeMicro;
interface TimeSyncSend<TMilli> as TimeSyncSendMilli[am_id_t id];
--- 31,35 ----
interface TimeSyncSend<TMicro> as TimeSyncSendMicro[am_id_t id];
interface TimeSyncPacket<TMicro> as TimeSyncPacketMicro;
! // interface LocalTime<TMicro> as LocalTimeMicro;
interface TimeSyncSend<TMilli> as TimeSyncSendMilli[am_id_t id];
***************
*** 52,56 ****
TimeSyncSendMicro = TimeSyncMessageP;
TimeSyncPacketMicro = TimeSyncMessageP;
! LocalTimeMicro = ActiveMessageC;
TimeSyncSendMilli = TimeSyncMessageP;
--- 52,56 ----
TimeSyncSendMicro = TimeSyncMessageP;
TimeSyncPacketMicro = TimeSyncMessageP;
! // LocalTimeMicro = LocalTimeMicroC;
TimeSyncSendMilli = TimeSyncMessageP;
***************
*** 61,67 ****
--- 61,70 ----
TimeSyncMessageP.SubSend -> ActiveMessageC.AMSend;
TimeSyncMessageP.SubPacket -> ActiveMessageC.Packet;
+ TimeSyncMessageP.PacketTimeStamp -> ActiveMessageC;
TimeSyncMessageP.LocalTimeMilli -> LocalTimeMilliC;
+ TimeSyncMessageP.PacketLastTouch -> ActiveMessageC;
+
SplitControl = ActiveMessageC;
Receive = ActiveMessageC.Receive;
Index: TimeSyncMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncMessageP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TimeSyncMessageP.nc 27 Mar 2008 21:59:28 -0000 1.2
--- TimeSyncMessageP.nc 29 Mar 2008 20:10:33 -0000 1.3
***************
*** 39,43 ****
interface AMSend as SubSend[uint8_t id];
interface Packet as SubPacket;
! interface PacketTimeStamp<TMicro,uint32_t>;
interface PacketLastTouch;
--- 39,43 ----
interface AMSend as SubSend[uint8_t id];
interface Packet as SubPacket;
! interface PacketTimeStamp<TMicro,uint16_t>; // TODO: change this to 32-bit
interface PacketLastTouch;
***************
*** 56,59 ****
--- 56,60 ----
} timesync_local_t;
+ // TODO: change the Packet.payloadLength and Packet.maxPayloadLength commands to async
inline timesync_footer_t* getFooter(message_t* msg)
{
***************
*** 102,106 ****
call PacketLastTouch.request(msg);
! return call SubSend.send[id](addr, msg, len);
}
--- 103,107 ----
call PacketLastTouch.request(msg);
! return call SubSend.send[id](addr, msg, len + sizeof(timesync_footer_t));
}
***************
*** 138,142 ****
call PacketLastTouch.request(msg);
! return call SubSend.send[id](addr, msg, len);
}
--- 139,143 ----
call PacketLastTouch.request(msg);
! return call SubSend.send[id](addr, msg, len + sizeof(timesync_footer_t));
}
--- PacketTimeSynch.nc DELETED ---
More information about the Tinyos-2-commits
mailing list