diff --git a/openair2/ENB_APP/enb_agent_common.c b/openair2/ENB_APP/enb_agent_common.c index c1d65f95cc3933ee09b0720072a200a8df14f518..c719777aaf7081c3718db4cb532c7ee016d54da7 100644 --- a/openair2/ENB_APP/enb_agent_common.c +++ b/openair2/ENB_APP/enb_agent_common.c @@ -294,6 +294,17 @@ int get_current_subframe (mid_t mod_id) { } +uint16_t get_sfn_sf (mid_t mod_id) { + + uint16_t frame, subframe; + uint16_t sfn_sf; + + frame = (uint16_t) get_current_frame(mod_id); + subframe = (uint16_t) get_current_subframe(mod_id); + sfn_sf = (frame << 12) | subframe; + return sfn_sf; +} + int get_num_ues (mid_t mod_id){ return ((UE_list_t *)enb_ue[mod_id])->num_UEs; diff --git a/openair2/ENB_APP/enb_agent_common.h b/openair2/ENB_APP/enb_agent_common.h index ca5aafbfdd323957791cabce87008435cf6919ee..9c5f4044fa8b079ad1b163fcb810a8461cefaff8 100644 --- a/openair2/ENB_APP/enb_agent_common.h +++ b/openair2/ENB_APP/enb_agent_common.h @@ -108,6 +108,10 @@ int get_current_frame(mid_t mod_id); int get_current_subframe(mid_t mod_id); +/*Return the frame and subframe number in compact 16-bit format. + Bits 0-3 frame, rest for subframe. Required by progRAN protocol*/ +uint16_t get_sfn_sf (mid_t mod_id); + int get_num_ues(mid_t mod_id); int get_ue_crnti (mid_t mod_id, mid_t ue_id); diff --git a/openair2/ENB_APP/enb_agent_mac.c b/openair2/ENB_APP/enb_agent_mac.c index edf1406296e83bf5d7d3a69d9cb98f226425f838..4801d2168623dee7848a1a2f6c3ed278a51484d2 100644 --- a/openair2/ENB_APP/enb_agent_mac.c +++ b/openair2/ENB_APP/enb_agent_mac.c @@ -296,7 +296,7 @@ int enb_agent_mac_stats_reply(mid_t mod_id, goto error; protocol__prp_dl_cqi_report__init(dl_report); //TODO:Set the SFN and SF of the last report held in the agent. - dl_report->sfn_sn = get_current_time_ms(enb_id, 1); + dl_report->sfn_sn = get_sfn_sf(enb_id); dl_report->has_sfn_sn = 1; //TODO:Set the number of DL CQI reports for this UE. One for each CC dl_report->n_csi_report = 1; @@ -391,7 +391,7 @@ int enb_agent_mac_stats_reply(mid_t mod_id, goto error; protocol__prp_ul_cqi_report__init(full_ul_report); //TODO:Set the SFN and SF of the generated report - full_ul_report->sfn_sn = 100; + full_ul_report->sfn_sn = get_sfn_sf(enb_id); full_ul_report->has_sfn_sn = 1; //TODO:Set the number of UL measurement reports based on the types of measurements //configured for this UE and on the servCellIndex @@ -461,7 +461,7 @@ int enb_agent_mac_stats_reply(mid_t mod_id, goto error; protocol__prp_noise_interference_report__init(ni_report); // Current frame and subframe number - ni_report->sfn_sf = 0; + ni_report->sfn_sf = get_sfn_sf(enb_id); ni_report->has_sfn_sf = 1; // Received interference power in dbm ni_report->rip = 0;