From f52e2f4007645f744e36e88c16ad05690ad2e4d8 Mon Sep 17 00:00:00 2001 From: scipio Date: Fri, 20 Jul 2007 22:35:11 +0000 Subject: [PATCH] Bug fix from Avrinash at USC; when detecting a clear channel, you care about not just noise, but also concurrent transmissions. Before, CpmModelC was only looking at noise, so it would transmit when other nodes nearby were transmitting, leading to very pessimistic packet delivery rates. --- tos/lib/tossim/CpmModelC.nc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tos/lib/tossim/CpmModelC.nc b/tos/lib/tossim/CpmModelC.nc index 59f94e10..1fc5fb64 100644 --- a/tos/lib/tossim/CpmModelC.nc +++ b/tos/lib/tossim/CpmModelC.nc @@ -200,8 +200,8 @@ implementation { } command bool Model.clearChannel() { - dbg("CpmModelC", "Checking clear channel @ %s: %f <= %f \n", sim_time_string(), (double)noise_hash_generation(), clearThreshold); - return noise_hash_generation() < clearThreshold; + dbg("CpmModelC", "Checking clear channel @ %s: %f <= %f \n", sim_time_string(), (double)packetNoise(NULL), clearThreshold); + return packetNoise(NULL) < clearThreshold; } void sim_gain_schedule_ack(int source, sim_time_t t, receive_message_t* r) { -- 2.39.2