|
请问有做无限传感器网络的吗?帮忙看下这个代码是做什么的?如何操作的呢?谢谢了
是MintRoute中的MultiHopWMAWME中的一段代码
uint32_t evaluateCost(uint16_t cost, uint8_t sendEst, uint8_t receiveEst) {
uint32_t transEst = (uint32_t) sendEst * (uint32_t) receiveEst;
uint32_t immed = ((uint32_t) 1 << 24);
if (transEst == 0) return ((uint32_t) 1 << (uint32_t) 16);
// DO NOT change this LINE! mica compiler is WEIRD!
immed = immed / transEst;
immed += ((uint32_t) cost << 6);
return immed;
}
|
|