DownlinkBurstProfile* Mac802_16::CreateDlBurstProfile_link(int NodeID)
{
DownlinkBurstProfile_link *tmp = new DownlinkBurstProfile_link;
DownlinkBurstProfile *tmp2 = new DownlinkBurstProfile;
tmp->NodeID = NodeID;
if(!DownlinkBurstProfile_link_head) {
tmp->DlBurstProfile_head = tmp->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
DownlinkBurstProfile_link_head = DownlinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
DownlinkBurstProfile_link *pt = DownlinkBurstProfile_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->DlBurstProfile_tail->next = tmp2;
pt->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->DlBurstProfile_head = tmp->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
DownlinkBurstProfile_link_tail->next = tmp;
DownlinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}
沒有留言:
張貼留言