From: scipio Date: Fri, 20 Jul 2007 22:35:11 +0000 (+0000) Subject: Bug fix from Avrinash at USC; when detecting a clear channel, you care X-Git-Tag: release_tools_1_2_4_1~16 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=f52e2f4007645f744e36e88c16ad05690ad2e4d8 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. --- 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) {