/* Compute this neighbor's path metric */
linkEtx = evaluateEtx(call LinkEstimator.getLinkQuality(entry->neighbor));
dbg("TreeRouting",
- "routingTable[%d]: neighbor: [id: %d parent: %d etx: %d]\n",
- i, entry->neighbor, entry->info.parent, linkEtx);
+ "routingTable[%d]: neighbor: [id: %d parent: %d etx: %d retx: %d]\n",
+ i, entry->neighbor, entry->info.parent, linkEtx, entry->info.etx);
pathEtx = linkEtx + entry->info.etx;
/* Operations specific to the current parent */
if (entry->neighbor == routeInfo.parent) {
}
if (pathEtx < minEtx) {
+ dbg("TreeRouting", " best is %d, setting to %d\n", pathEtx, entry->neighbor);
minEtx = pathEtx;
best = entry;
}
call LinkEstimator.unpinNeighbor(routeInfo.parent);
call LinkEstimator.pinNeighbor(best->neighbor);
call LinkEstimator.clearDLQ(best->neighbor);
- atomic {
+
+ atomic {
routeInfo.parent = best->neighbor;
routeInfo.etx = best->info.etx;
routeInfo.congested = best->info.congested;
}
+ if (currentEtx - minEtx > 20) {
+ call CtpInfo.triggerRouteUpdate();
+ }
}
}
}
- ctp_routing_header_t* getHeader(message_t* m) {
+ ctp_routing_header_t* getHeader(message_t* ONE m) {
return (ctp_routing_header_t*)call BeaconSend.getPayload(m, call BeaconSend.maxPayloadLength());
}