]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/ctp/CtpRoutingEngineP.nc
get etx now returns etx for the path to the root instead of etx from the current...
[tinyos-2.x.git] / tos / lib / net / ctp / CtpRoutingEngineP.nc
index a2d935f8cfbbb8455511fc78a0b162e86508befb..5a595341ae9c015f5f2013d974838272ae1ec518 100644 (file)
@@ -548,7 +548,12 @@ implementation {
             return FAIL;
         if (routeInfo.parent == INVALID_ADDR)    
             return FAIL;
-        *etx = routeInfo.etx;
+       if (state_is_root == 1) {
+         *etx = 0;
+       } else {
+         // path etx = etx(parent) + etx(link to the parent)
+         *etx = routeInfo.etx + evaluateEtx(call LinkEstimator.getLinkQuality(routeInfo.parent));
+       }
         return SUCCESS;
     }