/* Converts the output of the link estimator to path metric
* units, that can be *added* to form path metric measures */
- uint16_t evaluateEtx(uint8_t quality) {
+ uint16_t evaluateEtx(uint16_t quality) {
//dbg("TreeRouting","%s %d -> %d\n",__FUNCTION__,quality, quality+10);
return (quality + 10);
}
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;
}