All nodes that are in Range are not receiving Message in LEACH

心已入冬 提交于 2019-12-12 04:56:18

问题


when I send Broadcast notification to other nodes some nodes are not receiving the notification. below is code. Any help is appreciated Thanks

int clusterCode;
int numCodesAvail;

numCodesAvail = 2 * config_.spreading_ - 1;


currentCH_ = sensor_node_->nodeid();
currentCHMAC_ = MAC_BROADCAST;

clusterCode = (mac_->myADVnum() % numCodesAvail) + 1;

setCode(clusterCode);

wakeUp();

send(
    MAC_BROADCAST,
    LINK_BROADCAST,
    LEACH_ADV_CH,
    (char *) (&code_),
    sizeof(currentCH_),
    BYTES_ID,
    config_.maxDist_,
    0);

listenJOINREQ_ = true;

clusterNodes_.clear();

This works fine in first round but in second some of the nodes are not receiving the notification.

来源:https://stackoverflow.com/questions/23892557/all-nodes-that-are-in-range-are-not-receiving-message-in-leach

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!