Commit 991e9950 authored by Xenofon Foukas's avatar Xenofon Foukas

Changed get_harq function to provide both id and status at once

parent e6e117a5
......@@ -781,29 +781,28 @@ int get_tpc(mid_t mod_id, mid_t ue_id)
return tpc;
}
int get_harq(mid_t mod_id,uint8_t CC_id,mid_t ue_id, int frame, uint8_t subframe, int flag_id_status) //flag_id_status = 0 then id, else status
int get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, int *id, int *status) //flag_id_status = 0 then id, else status
{
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
uint8_t *harq_pid = malloc(sizeof(uint8_t));
uint8_t *round = malloc(sizeof(uint8_t));
uint8_t harq_pid;
uint8_t round;
uint16_t rnti = get_ue_crnti(mod_id,ue_id);
mac_xface->get_ue_active_harq_pid(mod_id,CC_id,rnti,frame,subframe,&harq_pid,&round,0);
if(flag_id_status == 0)
return *harq_pid;
else if(flag_id_status == 1)
{
if(*round > 0)
return 1;
else
return 0;
*id = harq_pid;
if (round > 0) {
*status = 1;
} else {
*status = 0;
}
return 150;
return 0;
}
......
......@@ -204,7 +204,8 @@ int get_num_pdcch_symb(mid_t mod_id, int CC_id);
int get_tpc(mid_t mod_id, mid_t ue_id);
int get_harq(mid_t mod_id,uint8_t CC_id,mid_t ue_id, int frame, uint8_t subframe, int flag_id_status);
int get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
const int frame, const uint8_t subframe, int *id, int *status);
/*******************
* timer primitves
......
......@@ -926,13 +926,17 @@ int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Progran
dl_info[i]->rnti = get_ue_crnti(mod_id, i);
dl_info[i]->has_rnti = 1;
/*TODO: fill in the right id of this round's HARQ process for this UE*/
dl_info[i]->harq_process_id = get_harq(mod_id,UE_PCCID(mod_id,i),i,get_current_frame(mod_id),get_current_subframe(mod_id),0);
int harq_id;
int harq_status;
get_harq(mod_id,UE_PCCID(mod_id,i),i,get_current_frame(mod_id),get_current_subframe(mod_id),&harq_id, &harq_status);
dl_info[i]->harq_process_id = harq_id;
dl_info[i]->has_harq_process_id = 1;
/*TODO: fill in the status of the HARQ process (2 TBs)*/
dl_info[i]->n_harq_status = 2;
dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status);
for (j = 0; j < dl_info[j]->n_harq_status; j++) {
dl_info[i]->harq_status[j] = get_harq(mod_id,UE_PCCID(mod_id,i),i,get_current_frame(mod_id),get_current_subframe(mod_id),1);
// TODO: This should be different per TB
dl_info[i]->harq_status[j] = harq_status;
}
/*TODO: fill in the serving cell index for this UE */
dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment