UplinkBurstProfile* Mac802_16::CreateUlBurstProfile_link(int NodeID)
{
UplinkBurstProfile_link *tmp = new UplinkBurstProfile_link;
UplinkBurstProfile *tmp2 = new UplinkBurstProfile;
tmp->NodeID = NodeID;
if(!UplinkBurstProfile_link_head) {
tmp->UlBurstProfile_head = tmp->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
UplinkBurstProfile_link_head = UplinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
UplinkBurstProfile_link *pt = UplinkBurstProfile_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->UlBurstProfile_tail->next = tmp2;
pt->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->UlBurstProfile_head = tmp->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
UplinkBurstProfile_link_tail->next = tmp;
UplinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}
沒有留言:
張貼留言