2010년 1월 10일 일요일

Is this a bug in Moteiv Boomerang MultiHop?

In selectParent() function of MultihopLQIM.nc, is the following line a bug?


if (parents[i].cost + parents[i].estimate < newparent) {

---------------------------------------------------------------------------

Should "newparent" be "parentestimate" ??

void selectParent() {
  int i;
  int newparent = m_parent;
  uint16_t parentestimate = parents[m_parent].cost +
  parents[m_parent].estimate;

  // if our parent is invalid, pick the best parent
  if (parents[m_parent].addr == MHOP_INVALID_PARENT) {
    for (i = 0; i < MHOP_PARENT_SIZE; i++) {
    if (parents[i].cost + parents[i].estimate < newparent) {
      newparent = i;
      parentestimate = parents[i].cost + parents[i].estimate;
    }
  }
}
// if we have a parent, don't switch unless they're worthwhile

...
tinyos-help

댓글 없음:

댓글 쓰기