[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/rf230 RF230ActiveMessage.h, 1.1, 1.2 RF230ActiveMessageC.nc, 1.4, 1.5 RF230ActiveMessageP.nc, 1.5, 1.6
Miklos Maroti
mmaroti at users.sourceforge.net
Fri Apr 3 17:43:57 PDT 2009
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/rf212 RF212ActiveMessage.h, 1.1, 1.2 RF212ActiveMessageC.nc, 1.4, 1.5 RF212ActiveMessageP.nc, 1.4, 1.5
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/layers ActiveMessageConfig.nc, 1.2, 1.3 ActiveMessageLayerC.nc, 1.2, 1.3 ActiveMessageLayerP.nc, 1.1, 1.2 DummyLayerC.nc, 1.2, 1.3 GenericTimeSyncMessageP.nc, 1.1, 1.2 IEEE154MessageLayer.h, 1.1, 1.2 IEEE154MessageLayer.nc, 1.1, 1.2 IEEE154MessageLayerC.nc, 1.1, 1.2 IEEE154MessageLayerP.nc, 1.1, 1.2 LowPowerListeningConfig.nc, 1.1, 1.2 LowPowerListeningDummyC.nc, 1.1, 1.2 LowPowerListeningLayerC.nc, 1.4, 1.5 LowPowerListeningLayerP.nc, 1.4, 1.5 LowpanNetworkLayerC.nc, 1.1, 1.2 MetadataFlagsLayerC.nc, 1.1, 1.2 PacketLinkLayerC.nc, 1.2, 1.3 PacketLinkLayerP.nc, 1.2, 1.3 SoftwareAckLayerC.nc, 1.2, 1.3 SoftwareAckLayerP.nc, 1.2, 1.3 TimeStampingLayerC.nc, 1.1, 1.2 TimeStampingLayerP.nc, 1.1, 1.2 IEEE154MessageConfig.nc, 1.1, NONE LowpanNetworkConfig.nc, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32361/rf230
Modified Files:
RF230ActiveMessage.h RF230ActiveMessageC.nc
RF230ActiveMessageP.nc
Log Message:
reorganized packet header handling
Index: RF230ActiveMessage.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230ActiveMessage.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RF230ActiveMessage.h 2 Apr 2009 22:10:07 -0000 1.1
--- RF230ActiveMessage.h 4 Apr 2009 00:43:55 -0000 1.2
***************
*** 25,29 ****
#define __RF230ACTIVEMESSAGE_H__
! #include <IEEE154PacketLayer.h>
#include <MetadataFlagsLayer.h>
#include <RF230DriverLayer.h>
--- 25,31 ----
#define __RF230ACTIVEMESSAGE_H__
! #include <IEEE154MessageLayer.h>
! #include <LowpanNetworkLayer.h>
! #include <ActiveMessageLayer.h>
#include <MetadataFlagsLayer.h>
#include <RF230DriverLayer.h>
***************
*** 32,36 ****
#include <PacketLinkLayer.h>
! typedef ieee154_header_t rf230packet_header_t;
typedef nx_struct rf230packet_footer_t
--- 34,45 ----
#include <PacketLinkLayer.h>
! typedef nx_struct rf230packet_header_t
! {
! ieee154_header_t ieee154;
! #ifndef TFRAMES_ENABLED
! lowpan_header_t lowpan;
! #endif
! activemessage_header_t am;
! } rf230packet_header_t;
typedef nx_struct rf230packet_footer_t
Index: RF230ActiveMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230ActiveMessageC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RF230ActiveMessageC.nc 2 Apr 2009 22:10:07 -0000 1.4
--- RF230ActiveMessageC.nc 4 Apr 2009 00:43:55 -0000 1.5
***************
*** 57,61 ****
implementation
{
! components RF230ActiveMessageP, IEEE154PacketLayerC, RadioAlarmC;
#ifdef RADIO_DEBUG
--- 57,61 ----
implementation
{
! components RF230ActiveMessageP, RadioAlarmC;
#ifdef RADIO_DEBUG
***************
*** 63,93 ****
#endif
! RF230ActiveMessageP.IEEE154PacketLayer -> IEEE154PacketLayerC;
RF230ActiveMessageP.RadioAlarm -> RadioAlarmC.RadioAlarm[unique("RadioAlarm")];
RF230ActiveMessageP.PacketTimeStamp -> TimeStampingLayerC;
-
Packet = RF230ActiveMessageP;
! // -------- ActiveMessage
components ActiveMessageLayerC;
ActiveMessageLayerC.Config -> RF230ActiveMessageP;
! ActiveMessageLayerC.AMPacket -> IEEE154PacketLayerC;
! ActiveMessageLayerC.SubSend -> IEEE154NetworkLayerC;
! ActiveMessageLayerC.SubReceive -> IEEE154NetworkLayerC;
AMSend = ActiveMessageLayerC;
Receive = ActiveMessageLayerC.Receive;
Snoop = ActiveMessageLayerC.Snoop;
! AMPacket = IEEE154PacketLayerC;
! // -------- IEEE154Network
#ifdef TFRAMES_ENABLED
! components new DummyLayerC() as IEEE154NetworkLayerC;
#else
! components IEEE154NetworkLayerC;
#endif
! IEEE154NetworkLayerC.SubSend -> UniqueLayerC;
! IEEE154NetworkLayerC.SubReceive -> LowPowerListeningLayerC;
// -------- UniqueLayer Send part (wired twice)
--- 63,97 ----
#endif
! RF230ActiveMessageP.IEEE154MessageLayer -> IEEE154MessageLayerC;
RF230ActiveMessageP.RadioAlarm -> RadioAlarmC.RadioAlarm[unique("RadioAlarm")];
RF230ActiveMessageP.PacketTimeStamp -> TimeStampingLayerC;
Packet = RF230ActiveMessageP;
! // -------- Active Message
components ActiveMessageLayerC;
ActiveMessageLayerC.Config -> RF230ActiveMessageP;
! ActiveMessageLayerC.SubSend -> LowpanNetworkLayerC;
! ActiveMessageLayerC.SubReceive -> LowpanNetworkLayerC;
AMSend = ActiveMessageLayerC;
Receive = ActiveMessageLayerC.Receive;
Snoop = ActiveMessageLayerC.Snoop;
! AMPacket = ActiveMessageLayerC;
! // -------- Lowpan Network
#ifdef TFRAMES_ENABLED
! components new DummyLayerC() as LowpanNetworkLayerC;
#else
! components LowpanNetworkLayerC;
! LowpanNetworkLayerC.Config -> RF230ActiveMessageP;
#endif
! LowpanNetworkLayerC.SubSend -> UniqueLayerC;
! LowpanNetworkLayerC.SubReceive -> LowPowerListeningLayerC;
!
! // -------- IEEE154 Packet
!
! components IEEE154MessageLayerC;
! IEEE154MessageLayerC.Config -> RF230ActiveMessageP;
// -------- UniqueLayer Send part (wired twice)
***************
*** 101,106 ****
#ifdef LOW_POWER_LISTENING
components LowPowerListeningLayerC;
! LowPowerListeningLayerC.PacketLplMetadata -> RF230ActiveMessageP;
! LowPowerListeningLayerC.IEEE154PacketLayer -> IEEE154PacketLayerC;
LowPowerListeningLayerC.PacketAcknowledgements -> SoftwareAckLayerC;
#else
--- 105,109 ----
#ifdef LOW_POWER_LISTENING
components LowPowerListeningLayerC;
! LowPowerListeningLayerC.Config -> RF230ActiveMessageP;
LowPowerListeningLayerC.PacketAcknowledgements -> SoftwareAckLayerC;
#else
Index: RF230ActiveMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/rf230/RF230ActiveMessageP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RF230ActiveMessageP.nc 2 Apr 2009 22:10:07 -0000 1.5
--- RF230ActiveMessageP.nc 4 Apr 2009 00:43:55 -0000 1.6
***************
*** 38,41 ****
--- 38,43 ----
interface SlottedCollisionConfig;
interface ActiveMessageConfig;
+ interface LowpanNetworkConfig;
+ interface IEEE154MessageConfig;
interface DummyConfig;
***************
*** 47,51 ****
#ifdef LOW_POWER_LISTENING
! interface PacketData<lpl_metadata_t> as PacketLplMetadata;
#endif
#ifdef PACKET_LINK
--- 49,53 ----
#ifdef LOW_POWER_LISTENING
! interface LowPowerListeningConfig;
#endif
#ifdef PACKET_LINK
***************
*** 56,60 ****
uses
{
! interface IEEE154PacketLayer;
interface RadioAlarm;
--- 58,62 ----
uses
{
! interface IEEE154MessageLayer;
interface RadioAlarm;
***************
*** 65,83 ****
implementation
{
/*----------------- RF230DriverConfig -----------------*/
async command uint8_t RF230DriverConfig.getLength(message_t* msg)
{
! return call IEEE154PacketLayer.getLength(msg);
}
async command void RF230DriverConfig.setLength(message_t* msg, uint8_t len)
{
! call IEEE154PacketLayer.setLength(msg, len);
}
async command uint8_t* RF230DriverConfig.getPayload(message_t* msg)
{
! return ((uint8_t*)(call IEEE154PacketLayer.getHeader(msg))) + 1;
}
--- 67,95 ----
implementation
{
+ rf230packet_header_t* getHeader(message_t* msg)
+ {
+ return (rf230packet_header_t*)(msg->data - sizeof(rf230packet_header_t));
+ }
+
+ rf230packet_metadata_t* getMeta(message_t* msg)
+ {
+ return (rf230packet_metadata_t*)(msg->metadata);
+ }
+
/*----------------- RF230DriverConfig -----------------*/
async command uint8_t RF230DriverConfig.getLength(message_t* msg)
{
! return call IEEE154MessageLayer.getLength(msg);
}
async command void RF230DriverConfig.setLength(message_t* msg, uint8_t len)
{
! call IEEE154MessageLayer.setLength(msg, len);
}
async command uint8_t* RF230DriverConfig.getPayload(message_t* msg)
{
! return ((uint8_t*)(call IEEE154MessageConfig.getHeader(msg))) + 1;
}
***************
*** 96,100 ****
async command bool RF230DriverConfig.requiresRssiCca(message_t* msg)
{
! return call IEEE154PacketLayer.isDataFrame(msg);
}
--- 108,112 ----
async command bool RF230DriverConfig.requiresRssiCca(message_t* msg)
{
! return call IEEE154MessageLayer.isDataFrame(msg);
}
***************
*** 103,132 ****
async command bool SoftwareAckConfig.requiresAckWait(message_t* msg)
{
! return call IEEE154PacketLayer.requiresAckWait(msg);
}
async command bool SoftwareAckConfig.isAckPacket(message_t* msg)
{
! return call IEEE154PacketLayer.isAckFrame(msg);
}
async command bool SoftwareAckConfig.verifyAckPacket(message_t* data, message_t* ack)
{
! return call IEEE154PacketLayer.verifyAckReply(data, ack);
}
async command void SoftwareAckConfig.setAckRequired(message_t* msg, bool ack)
{
! call IEEE154PacketLayer.setAckRequired(msg, ack);
}
async command bool SoftwareAckConfig.requiresAckReply(message_t* msg)
{
! return call IEEE154PacketLayer.requiresAckReply(msg);
}
async command void SoftwareAckConfig.createAckPacket(message_t* data, message_t* ack)
{
! call IEEE154PacketLayer.createAckReply(data, ack);
}
--- 115,144 ----
async command bool SoftwareAckConfig.requiresAckWait(message_t* msg)
{
! return call IEEE154MessageLayer.requiresAckWait(msg);
}
async command bool SoftwareAckConfig.isAckPacket(message_t* msg)
{
! return call IEEE154MessageLayer.isAckFrame(msg);
}
async command bool SoftwareAckConfig.verifyAckPacket(message_t* data, message_t* ack)
{
! return call IEEE154MessageLayer.verifyAckReply(data, ack);
}
async command void SoftwareAckConfig.setAckRequired(message_t* msg, bool ack)
{
! call IEEE154MessageLayer.setAckRequired(msg, ack);
}
async command bool SoftwareAckConfig.requiresAckReply(message_t* msg)
{
! return call IEEE154MessageLayer.requiresAckReply(msg);
}
async command void SoftwareAckConfig.createAckPacket(message_t* data, message_t* ack)
{
! call IEEE154MessageLayer.createAckReply(data, ack);
}
***************
*** 145,159 ****
async command uint8_t UniqueConfig.getSequenceNumber(message_t* msg)
{
! return call IEEE154PacketLayer.getDSN(msg);
}
async command void UniqueConfig.setSequenceNumber(message_t* msg, uint8_t dsn)
{
! call IEEE154PacketLayer.setDSN(msg, dsn);
}
async command am_addr_t UniqueConfig.getSender(message_t* msg)
{
! return call IEEE154PacketLayer.getSrcAddr(msg);
}
--- 157,171 ----
async command uint8_t UniqueConfig.getSequenceNumber(message_t* msg)
{
! return call IEEE154MessageLayer.getDSN(msg);
}
async command void UniqueConfig.setSequenceNumber(message_t* msg, uint8_t dsn)
{
! call IEEE154MessageLayer.setDSN(msg, dsn);
}
async command am_addr_t UniqueConfig.getSender(message_t* msg)
{
! return call IEEE154MessageLayer.getSrcAddr(msg);
}
***************
*** 168,172 ****
{
// the user forgot to call clear, we should return EINVAL
! if( ! call IEEE154PacketLayer.isDataFrame(msg) )
call Packet.clear(msg);
--- 180,184 ----
{
// the user forgot to call clear, we should return EINVAL
! if( ! call IEEE154MessageLayer.isDataFrame(msg) )
call Packet.clear(msg);
***************
*** 174,182 ****
}
/*----------------- CsmaConfig -----------------*/
async command bool CsmaConfig.requiresSoftwareCCA(message_t* msg)
{
! return call IEEE154PacketLayer.isDataFrame(msg);
}
--- 186,229 ----
}
+ command activemessage_header_t* ActiveMessageConfig.getHeader(message_t* msg)
+ {
+ return &(getHeader(msg)->am);
+ }
+
+ command am_addr_t ActiveMessageConfig.destination(message_t* msg)
+ {
+ return call IEEE154MessageLayer.getDestAddr(msg);
+ }
+
+ command void ActiveMessageConfig.setDestination(message_t* msg, am_addr_t addr)
+ {
+ call IEEE154MessageLayer.setDestAddr(msg, addr);
+ }
+
+ command am_addr_t ActiveMessageConfig.source(message_t* msg)
+ {
+ return call IEEE154MessageLayer.getSrcAddr(msg);
+ }
+
+ command void ActiveMessageConfig.setSource(message_t* msg, am_addr_t addr)
+ {
+ call IEEE154MessageLayer.setSrcAddr(msg, addr);
+ }
+
+ command am_group_t ActiveMessageConfig.group(message_t* msg)
+ {
+ return call IEEE154MessageLayer.getDestPan(msg);
+ }
+
+ command void ActiveMessageConfig.setGroup(message_t* msg, am_group_t grp)
+ {
+ call IEEE154MessageLayer.setDestPan(msg, grp);
+ }
+
/*----------------- CsmaConfig -----------------*/
async command bool CsmaConfig.requiresSoftwareCCA(message_t* msg)
{
! return call IEEE154MessageLayer.isDataFrame(msg);
}
***************
*** 203,213 ****
*/
! uint8_t len = call IEEE154PacketLayer.getLength(msg);
! return call IEEE154PacketLayer.getAckRequired(msg) ? len + 6 + 16 + 11 + 10 : len + 6 + 10;
}
async command am_addr_t TrafficMonitorConfig.getSender(message_t* msg)
{
! return call IEEE154PacketLayer.getSrcAddr(msg);
}
--- 250,260 ----
*/
! uint8_t len = call IEEE154MessageLayer.getLength(msg);
! return call IEEE154MessageLayer.getAckRequired(msg) ? len + 6 + 16 + 11 + 10 : len + 6 + 10;
}
async command am_addr_t TrafficMonitorConfig.getSender(message_t* msg)
{
! return call IEEE154MessageLayer.getSrcAddr(msg);
}
***************
*** 251,255 ****
// estimated response time (download the message, etc) is 5-8 bytes
! if( call IEEE154PacketLayer.requiresAckReply(msg) )
time += (uint16_t)(32 * (-5 + 16 + 11 + 5) * RADIO_ALARM_MICROSEC);
else
--- 298,302 ----
// estimated response time (download the message, etc) is 5-8 bytes
! if( call IEEE154MessageLayer.requiresAckReply(msg) )
time += (uint16_t)(32 * (-5 + 16 + 11 + 5) * RADIO_ALARM_MICROSEC);
else
***************
*** 259,263 ****
}
! tasklet_async event void RadioAlarm.fired() { }
/*----------------- SlottedCollisionConfig -----------------*/
--- 306,312 ----
}
! tasklet_async event void RadioAlarm.fired()
! {
! }
/*----------------- SlottedCollisionConfig -----------------*/
***************
*** 298,308 ****
}
! /*----------------- Metadata -----------------*/
! inline rf230packet_metadata_t* getMeta(message_t* msg)
{
! return (rf230packet_metadata_t*)(msg->metadata);
}
async command flags_metadata_t* PacketFlagsMetadata.get(message_t* msg)
{
--- 347,382 ----
}
! /*----------------- LowpanNetwork -----------------*/
! command lowpan_header_t* LowpanNetworkConfig.getHeader(message_t* msg)
{
! return &(getHeader(msg)->lowpan);
! }
!
! /*----------------- IEEE154Message -----------------*/
!
! async command ieee154_header_t* IEEE154MessageConfig.getHeader(message_t* msg)
! {
! return &(getHeader(msg)->ieee154);
! }
!
! /*----------------- LowPowerListening -----------------*/
!
! #ifdef LOW_POWER_LISTENING
!
! async command lpl_metadata_t* LowPowerListeningConfig.metadata(message_t* msg)
! {
! return &(getMeta(msg)->lpl);
! }
!
! async command bool LowPowerListeningConfig.getAckRequired(message_t* msg)
! {
! return call IEEE154MessageLayer.getAckRequired(msg);
}
+ #endif
+
+ /*----------------- Headers and Metadata -----------------*/
+
async command flags_metadata_t* PacketFlagsMetadata.get(message_t* msg)
{
***************
*** 320,330 ****
}
- #ifdef LOW_POWER_LISTENING
- async command lpl_metadata_t* PacketLplMetadata.get(message_t* msg)
- {
- return &(getMeta(msg)->lpl);
- }
- #endif
-
#ifdef PACKET_LINK
async command link_metadata_t* PacketLinkMetadata.get(message_t* msg)
--- 394,397 ----
***************
*** 349,371 ****
signal PacketTimeStampMetadata.clear(msg);
#ifdef LOW_POWER_LISTENING
! signal PacketLplMetadata.clear(msg);
#endif
#ifdef PACKET_LINK
signal PacketLinkMetadata.clear(msg);
#endif
! call IEEE154PacketLayer.createDataFrame(msg);
}
! inline command void Packet.setPayloadLength(message_t* msg, uint8_t len)
{
! call IEEE154PacketLayer.setLength(msg, len + PACKET_LENGTH_INCREASE);
}
! inline command uint8_t Packet.payloadLength(message_t* msg)
{
! return call IEEE154PacketLayer.getLength(msg) - PACKET_LENGTH_INCREASE;
}
! inline command uint8_t Packet.maxPayloadLength()
{
return TOSH_DATA_LENGTH;
--- 416,438 ----
signal PacketTimeStampMetadata.clear(msg);
#ifdef LOW_POWER_LISTENING
! signal LowPowerListeningConfig.clear(msg);
#endif
#ifdef PACKET_LINK
signal PacketLinkMetadata.clear(msg);
#endif
! call IEEE154MessageLayer.createDataFrame(msg);
}
! command void Packet.setPayloadLength(message_t* msg, uint8_t len)
{
! call IEEE154MessageLayer.setLength(msg, len + PACKET_LENGTH_INCREASE);
}
! command uint8_t Packet.payloadLength(message_t* msg)
{
! return call IEEE154MessageLayer.getLength(msg) - PACKET_LENGTH_INCREASE;
}
! command uint8_t Packet.maxPayloadLength()
{
return TOSH_DATA_LENGTH;
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/rf212 RF212ActiveMessage.h, 1.1, 1.2 RF212ActiveMessageC.nc, 1.4, 1.5 RF212ActiveMessageP.nc, 1.4, 1.5
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/layers ActiveMessageConfig.nc, 1.2, 1.3 ActiveMessageLayerC.nc, 1.2, 1.3 ActiveMessageLayerP.nc, 1.1, 1.2 DummyLayerC.nc, 1.2, 1.3 GenericTimeSyncMessageP.nc, 1.1, 1.2 IEEE154MessageLayer.h, 1.1, 1.2 IEEE154MessageLayer.nc, 1.1, 1.2 IEEE154MessageLayerC.nc, 1.1, 1.2 IEEE154MessageLayerP.nc, 1.1, 1.2 LowPowerListeningConfig.nc, 1.1, 1.2 LowPowerListeningDummyC.nc, 1.1, 1.2 LowPowerListeningLayerC.nc, 1.4, 1.5 LowPowerListeningLayerP.nc, 1.4, 1.5 LowpanNetworkLayerC.nc, 1.1, 1.2 MetadataFlagsLayerC.nc, 1.1, 1.2 PacketLinkLayerC.nc, 1.2, 1.3 PacketLinkLayerP.nc, 1.2, 1.3 SoftwareAckLayerC.nc, 1.2, 1.3 SoftwareAckLayerP.nc, 1.2, 1.3 TimeStampingLayerC.nc, 1.1, 1.2 TimeStampingLayerP.nc, 1.1, 1.2 IEEE154MessageConfig.nc, 1.1, NONE LowpanNetworkConfig.nc, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list