]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tossim/CpmModelC.nc
Bug fix from Avrinash at USC; when detecting a clear channel, you care
[tinyos-2.x.git] / tos / lib / tossim / CpmModelC.nc
index 59f94e10bbfbac4d264e9cb2767581229baac8c5..1fc5fb649735e0bd6a564f6ca940509a5ef94323 100644 (file)
@@ -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) {