[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/rf230 RF230ActiveMessageC.nc, 1.2, 1.3 RF230Packet.h, 1.2, 1.3 RF230PacketC.nc, 1.2, 1.3 RF230PacketP.nc, 1.2, 1.3

Miklos Maroti mmaroti at users.sourceforge.net
Mon Mar 30 15:29:50 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11481/rf230

Modified Files:
	RF230ActiveMessageC.nc RF230Packet.h RF230PacketC.nc 
	RF230PacketP.nc 
Log Message:
implement the PacketLink layer

Index: RF230ActiveMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230ActiveMessageC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RF230ActiveMessageC.nc	29 Mar 2009 21:12:06 -0000	1.2
--- RF230ActiveMessageC.nc	30 Mar 2009 22:29:48 -0000	1.3
***************
*** 37,41 ****
--- 37,48 ----
  		interface AMPacket;
  		interface PacketAcknowledgements;
+ 
+ 		// we provide a dummy LowPowerListening interface if LOW_POWER_LISTENING is not defined
  		interface LowPowerListening;
+ 
+ #ifdef PACKET_LINK
+ 		interface PacketLink;
+ #endif
+ 
  		interface RadioChannel;
  
***************
*** 78,89 ****
--- 85,111 ----
  	components IEEE154NetworkLayerC;
  #endif
+ 
  #ifdef LOW_POWER_LISTENING
  	components LowPowerListeningLayerC;
+ 	LowPowerListeningLayerC.PacketSleepInterval -> RF230PacketC;
+ 	LowPowerListeningLayerC.IEEE154Packet2 -> IEEE154Packet2C;
+ 	LowPowerListeningLayerC.PacketAcknowledgements -> RF230PacketC;
  #else	
  	components new DummyLayerC() as LowPowerListeningLayerC;
  #endif
+ 
+ #ifdef PACKET_LINK
+ 	components PacketLinkLayerC;
+ 	PacketLink = PacketLinkLayerC;
+ 	PacketLinkLayerC.PacketData -> RF230PacketC;
+ 	PacketLinkLayerC.PacketAcknowledgements -> RF230PacketC;
+ #else
+ 	components new DummyLayerC() as PacketLinkLayerC;
+ #endif
+ 
  	components MessageBufferLayerC;
  	components UniqueLayerC;
  	components TrafficMonitorLayerC;
+ 
  #ifdef SLOTTED_MAC
  	components SlottedCollisionLayerC as CollisionAvoidanceLayerC;
***************
*** 91,94 ****
--- 113,117 ----
  	components RandomCollisionLayerC as CollisionAvoidanceLayerC;
  #endif
+ 
  	components SoftwareAckLayerC;
  	components new DummyLayerC() as CsmaLayerC;
***************
*** 113,123 ****
  
  	LowPowerListeningLayerC.SubControl -> MessageBufferLayerC;
! 	LowPowerListeningLayerC.SubSend -> MessageBufferLayerC;
  	LowPowerListeningLayerC.SubReceive -> MessageBufferLayerC;
! #ifdef LOW_POWER_LISTENING
! 	LowPowerListeningLayerC.PacketSleepInterval -> RF230PacketC;
! 	LowPowerListeningLayerC.IEEE154Packet2 -> IEEE154Packet2C;
! 	LowPowerListeningLayerC.PacketAcknowledgements -> RF230PacketC;
! #endif
  
  	MessageBufferLayerC.Packet -> RF230PacketC;
--- 136,143 ----
  
  	LowPowerListeningLayerC.SubControl -> MessageBufferLayerC;
! 	LowPowerListeningLayerC.SubSend -> PacketLinkLayerC;
  	LowPowerListeningLayerC.SubReceive -> MessageBufferLayerC;
! 
! 	PacketLinkLayerC.SubSend -> MessageBufferLayerC;
  
  	MessageBufferLayerC.Packet -> RF230PacketC;

Index: RF230Packet.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230Packet.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RF230Packet.h	29 Mar 2009 21:12:06 -0000	1.2
--- RF230Packet.h	30 Mar 2009 22:29:48 -0000	1.3
***************
*** 26,29 ****
--- 26,30 ----
  
  #include <IEEE154Packet2.h>
+ #include <PacketLinkLayer.h>
  
  typedef ieee154_header_t rf230packet_header_t;
***************
*** 42,45 ****
--- 43,49 ----
  	uint16_t lpl_sleepint;
  #endif
+ #ifdef PACKET_LINK
+ 	packet_link_metadata_t packet_link;
+ #endif
  	uint32_t timestamp;
  } rf230packet_metadata_t;

Index: RF230PacketC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230PacketC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RF230PacketC.nc	29 Mar 2009 21:12:06 -0000	1.2
--- RF230PacketC.nc	30 Mar 2009 22:29:48 -0000	1.3
***************
*** 37,40 ****
--- 37,43 ----
  		interface PacketTimeStamp<TRadio, uint32_t> as PacketTimeStampRadio;
  		interface PacketTimeStamp<TMilli, uint32_t> as PacketTimeStampMilli;
+ #ifdef PACKET_LINK
+ 		interface PacketData<packet_link_metadata_t> as PaketLinkMetadata;
+ #endif
  	}
  }
***************
*** 60,62 ****
--- 63,69 ----
  	PacketTimeStampRadio	= RF230PacketP;
  	PacketTimeStampMilli	= RF230PacketP;
+ 
+ #ifdef PACKET_LINK
+ 	PaketLinkMetadata	= RF230PacketP;
+ #endif
  }

Index: RF230PacketP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230PacketP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RF230PacketP.nc	29 Mar 2009 21:12:06 -0000	1.2
--- RF230PacketP.nc	30 Mar 2009 22:29:48 -0000	1.3
***************
*** 7,16 ****
   * hereby granted, provided that the above copyright notice, the following
   * two paragraphs and the author appear in all copies of this software.
!  * 
   * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
   * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
   * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
   * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
--- 7,16 ----
   * hereby granted, provided that the above copyright notice, the following
   * two paragraphs and the author appear in all copies of this software.
!  *
   * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
   * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
   * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  *
   * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
***************
*** 25,28 ****
--- 25,29 ----
  #include <GenericTimeSyncMessage.h>
  #include <RadioConfig.h>
+ #include <PacketLinkLayer.h>
  
  module RF230PacketP
***************
*** 40,43 ****
--- 41,48 ----
  		interface PacketTimeStamp<TRadio, uint32_t> as PacketTimeStampRadio;
  		interface PacketTimeStamp<TMilli, uint32_t> as PacketTimeStampMilli;
+ 
+ #ifdef PACKET_LINK
+ 		interface PacketData<packet_link_metadata_t> as PacketLinkMetadata;
+ #endif
  	}
  
***************
*** 55,59 ****
  	enum
  	{
! 		PACKET_LENGTH_INCREASE = 
  			sizeof(rf230packet_header_t) - 1	// the 8-bit length field is not counted
  			+ sizeof(ieee154_footer_t),		// the CRC is not stored in memory
--- 60,64 ----
  	enum
  	{
! 		PACKET_LENGTH_INCREASE =
  			sizeof(rf230packet_header_t) - 1	// the 8-bit length field is not counted
  			+ sizeof(ieee154_footer_t),		// the CRC is not stored in memory
***************
*** 67,71 ****
  /*----------------- Packet -----------------*/
  
! 	command void Packet.clear(message_t* msg) 
  	{
  		call IEEE154Packet2.createDataFrame(msg);
--- 72,76 ----
  /*----------------- Packet -----------------*/
  
! 	command void Packet.clear(message_t* msg)
  	{
  		call IEEE154Packet2.createDataFrame(msg);
***************
*** 74,83 ****
  	}
  
! 	inline command void Packet.setPayloadLength(message_t* msg, uint8_t len) 
  	{
  		call IEEE154Packet2.setLength(msg, len + PACKET_LENGTH_INCREASE);
  	}
  
! 	inline command uint8_t Packet.payloadLength(message_t* msg) 
  	{
  		return call IEEE154Packet2.getLength(msg) - PACKET_LENGTH_INCREASE;
--- 79,88 ----
  	}
  
! 	inline command void Packet.setPayloadLength(message_t* msg, uint8_t len)
  	{
  		call IEEE154Packet2.setLength(msg, len + PACKET_LENGTH_INCREASE);
  	}
  
! 	inline command uint8_t Packet.payloadLength(message_t* msg)
  	{
  		return call IEEE154Packet2.getLength(msg) - PACKET_LENGTH_INCREASE;
***************
*** 288,290 ****
--- 293,305 ----
  #endif
  	}
+ 
+ /*----------------- PacketLinkMetadata -----------------*/
+ #ifdef PACKET_LINK
+ 
+ 	async command packet_link_metadata_t* PacketLinkMetadata.getData(message_t* msg)
+ 	{
+ 		return &(getMeta(msg)->packet_link);
+ 	}
+ 
+ #endif
  }



More information about the Tinyos-2-commits mailing list