]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tossim/CpmModelC.nc
Fix off by one error
[tinyos-2.x.git] / tos / lib / tossim / CpmModelC.nc
index 59f94e10bbfbac4d264e9cb2767581229baac8c5..97076322167319ad062910223d9804d962d66e15 100644 (file)
@@ -127,7 +127,7 @@ implementation {
     else {
       noise_val = (double)sim_noise_generate(node_id, quotient);
     }
-    dbg("CpmModelC", "OUT: noise_hash_generation()\n");
+    dbg("CpmModelC,Tal", "%s: OUT: noise_hash_generation(): %lf\n", sim_time_string(), noise_val);
 
     return noise_val;
   }
@@ -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) {