]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf230/DefaultPacketP.nc
fixing TimeSyncMessage for the IRIS
[tinyos-2.x.git] / tos / chips / rf230 / DefaultPacketP.nc
index a0cb16f36623ddaa520e80d94b8e64879879f3af..577ff252ca8f17219935c1cb2fdccc0170f5d20d 100644 (file)
@@ -33,6 +33,9 @@ module DefaultPacketP
                interface PacketField<uint8_t> as PacketTransmitPower;
 
                interface PacketTimeStamp<TRF230, uint16_t>;
+               interface PacketLastTouch;
+
+               async event void lastTouch(message_t* msg);
        }
 
        uses
@@ -190,4 +193,31 @@ implementation
                flags |= FLAG_TXPOWER;
                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)
+       {
+       }
 }