]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/dhv/DhvHSumP.nc
Clean up code
[tinyos-2.x.git] / tos / lib / net / dhv / DhvHSumP.nc
index 451f4423a483058341069b328274afe959d58fa7..32dd414ad6cf0eaabdf165c510f51fa88a963fa9 100755 (executable)
@@ -37,6 +37,9 @@ implementation{
     error_t sendResult;
 
     dmsg = call HSumSend.getPayloadPtr();
+    if(dmsg == NULL)
+        return FAIL;
+
     dmsg->type = ID_DHV_HSUM;
     dhsmsg = (dhv_hsum_msg_t*) dmsg->content;
 
@@ -75,6 +78,7 @@ implementation{
       local_hash = call DhvHelp.computeHash(0, UQCOUNT_DHV, salt);
       if(rcv_hash == local_hash) {
         call VBitLogic.setSameSummary();
+        commRate = commRate + 1;
       }else{
         call VBitLogic.setVBitState(1);
       }