From b1195b1508a754353cd512687cbfd88c1709dbcc Mon Sep 17 00:00:00 2001 From: mmaroti Date: Tue, 24 Nov 2009 07:38:15 +0000 Subject: [PATCH] changed displayed info for RF230Sniffer --- tos/chips/rf2xx/rf212/RF212DriverLayerP.nc | 22 +++++++++++----------- tos/chips/rf2xx/rf230/RF230DriverLayerP.nc | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tos/chips/rf2xx/rf212/RF212DriverLayerP.nc b/tos/chips/rf2xx/rf212/RF212DriverLayerP.nc index a2ac7dea..0bd62ab3 100644 --- a/tos/chips/rf2xx/rf212/RF212DriverLayerP.nc +++ b/tos/chips/rf2xx/rf212/RF212DriverLayerP.nc @@ -514,24 +514,25 @@ implementation // go back to RX_ON state when finished writeRegister(RF212_TRX_STATE, RF212_RX_ON); + if( timesync != 0 ) + *(timesync_absolute_t*)timesync = (*(timesync_relative_t*)timesync) + time32; + + call PacketTimeStamp.set(msg, time32); + #ifdef RADIO_DEBUG_MESSAGES if( call DiagMsg.record() ) { length = getHeader(msg)->length; - call DiagMsg.str("tx"); - call DiagMsg.uint16(time); - call DiagMsg.uint8(length); + call DiagMsg.str("t"); + call DiagMsg.uint32(call PacketTimeStamp.isValid(rxMsg) ? call PacketTimeStamp.timestamp(rxMsg) : 0); + call DiagMsg.uint16(call RadioAlarm.getNow()); + call DiagMsg.int8(length); call DiagMsg.hex8s(getPayload(msg), length - 2); call DiagMsg.send(); } #endif - if( timesync != 0 ) - *(timesync_absolute_t*)timesync = (*(timesync_relative_t*)timesync) + time32; - - call PacketTimeStamp.set(msg, time32); - // wait for the TRX_END interrupt state = STATE_BUSY_TX_2_RX_ON; cmd = CMD_TRANSMIT; @@ -624,11 +625,10 @@ implementation { length = getHeader(rxMsg)->length; - call DiagMsg.str("rx"); + call DiagMsg.str("r"); 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); + call DiagMsg.int8(crc != 0 ? length : -length); call DiagMsg.hex8s(getPayload(rxMsg), length - 2); call DiagMsg.send(); } diff --git a/tos/chips/rf2xx/rf230/RF230DriverLayerP.nc b/tos/chips/rf2xx/rf230/RF230DriverLayerP.nc index a46b90bc..7dbdb657 100644 --- a/tos/chips/rf2xx/rf230/RF230DriverLayerP.nc +++ b/tos/chips/rf2xx/rf230/RF230DriverLayerP.nc @@ -525,24 +525,25 @@ implementation // go back to RX_ON state when finished writeRegister(RF230_TRX_STATE, RF230_RX_ON); + if( timesync != 0 ) + *(timesync_absolute_t*)timesync = (*(timesync_relative_t*)timesync) + time32; + + call PacketTimeStamp.set(msg, time32); + #ifdef RADIO_DEBUG_MESSAGES if( call DiagMsg.record() ) { length = getHeader(msg)->length; - call DiagMsg.str("tx"); - call DiagMsg.uint16(time); - call DiagMsg.uint8(length); + call DiagMsg.str("t"); + call DiagMsg.uint32(call PacketTimeStamp.isValid(rxMsg) ? call PacketTimeStamp.timestamp(rxMsg) : 0); + call DiagMsg.uint16(call RadioAlarm.getNow()); + call DiagMsg.int8(length); call DiagMsg.hex8s(getPayload(msg), length - 2); call DiagMsg.send(); } #endif - if( timesync != 0 ) - *(timesync_absolute_t*)timesync = (*(timesync_relative_t*)timesync) + time32; - - call PacketTimeStamp.set(msg, time32); - // wait for the TRX_END interrupt state = STATE_BUSY_TX_2_RX_ON; cmd = CMD_TRANSMIT; @@ -637,11 +638,10 @@ implementation { length = getHeader(rxMsg)->length; - call DiagMsg.str("rx"); + call DiagMsg.str("r"); 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); + call DiagMsg.int8(crc == 0 ? length : -length); call DiagMsg.hex8s(getPayload(rxMsg), length - 2); call DiagMsg.send(); } -- 2.39.2