]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf230/RF230LayerP.nc
update RF230Sniffer to the new interfaces
[tinyos-2.x.git] / tos / chips / rf230 / RF230LayerP.nc
index 1485d226d8e23e092c2db96e854cd1de38b581d6..85058a77ae29271d2bf52797a55947a62ab0623c 100644 (file)
@@ -598,7 +598,7 @@ implementation
                        length = call RF230Config.getLength(rxMsg);
 
                        call DiagMsg.str("rx");
-                       call DiagMsg.uint32(call PacketTimeStamp.isSet(rxMsg) ? call PacketTimeStamp.get(rxMsg) : 0);
+                       call DiagMsg.uint32(call PacketTimeStamp.isValid(rxMsg) ? call PacketTimeStamp.timestamp(rxMsg) : 0);
                        call DiagMsg.uint16(call RadioAlarm.getNow());
                        call DiagMsg.uint8(crc != 0);
                        call DiagMsg.uint8(length);
@@ -634,6 +634,7 @@ implementation
                if( isSpiAcquired() )
                {
                        uint16_t time;
+                       uint32_t time32;
                        uint8_t irq;
                        uint8_t temp;
                        
@@ -713,7 +714,11 @@ implementation
                                         * CMD_TRANSMIT.
                                         */
                                        if( irq == RF230_IRQ_RX_START ) // just to be cautious
-                                               call PacketTimeStamp.set(rxMsg, time - RX_SFD_DELAY);
+                                       {
+                                               time32 = call LocalTime.get();
+                                               time32 += (int16_t)(time - RX_SFD_DELAY) - (int16_t)(time32);
+                                               call PacketTimeStamp.set(rxMsg, time32);
+                                       }
                                        else
                                                call PacketTimeStamp.clear(rxMsg);