Commit 901d02ef authored by Matthieu Kanj's avatar Matthieu Kanj

bug fix

parent 7a2f8749
...@@ -317,9 +317,10 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -317,9 +317,10 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
return(done); return(done);
} }
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
/*int generate_NDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI, /*int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI,
int32_t **txdataF, int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
...@@ -329,116 +330,80 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -329,116 +330,80 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
{ {
int done=0; int done=0;
uint8_t *DCI = RAR->harq_process->pdu; uint8_t *DCI_pdu = DCI->pdu;
uint32_t rep = RAR->repetition_number; uint32_t rep = DCI->repetition_number;
uint8_t eutro_control_region = 3; uint8_t eutro_control_region = 3;
uint32_t counter_rep = RAR->counter_repetition_number; uint32_t counter_rep = DCI->counter_repetition_number;
uint32_t counter_sf_rep = RAR->counter_current_sf_repetition; /// for identifiying when to trigger new scrambling uint32_t counter_sf_rep = DCI->counter_current_sf_repetition; /// for identifiying when to trigger new scrambling
uint32_t pointer_to_sf = RAR->pointer_to_subframe; /// to identify wich encoded subframe to transmit uint32_t pointer_to_sf = DCI->pointer_to_subframe; /// to identify wich encoded subframe to transmit
if( RAR->active == 1 ) if( DCI->active == 1 )
{ {
int G = get_G_NB_IoT(frame_parms); int G = get_G_NB_IoT(frame_parms);
uint8_t Nsf = RAR->number_of_subframes_for_resource_assignment; uint8_t Nsf = DCI->number_of_subframes_for_resource_assignment;
if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) ) if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{ {
dlsch_encoding_NB_IoT(RAR_pdu, dlsch_encoding_NB_IoT(DCI_pdu,
RAR, DCI,
Nsf, ///// number_of_subframes_required Nsf, ///// number_of_subframes_required
G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band
dlsch_scrambling_Gen_NB_IoT(frame_parms, dlsch_scrambling_Gen_NB_IoT(frame_parms,
RAR, DCI,
Nsf*G, Nsf*G,
frame, frame,
subframe*2, subframe*2,
RAR->rnti); DCI->rnti);
} }
if( (counter_rep != rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) ) if( (counter_rep != rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{ {
dlsch_scrambling_Gen_NB_IoT(frame_parms, dlsch_scrambling_Gen_NB_IoT(frame_parms,
RAR, DCI,
Nsf*G, Nsf*G,
frame, frame,
subframe*2, subframe*2,
RAR->rnti); DCI->rnti);
}
if( rep > 4)
{
RAR->counter_current_sf_repetition++;
dlsch_modulation_NB_IoT(txdataF,
amp,
frame_parms,
eutro_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
RAR,
G, // number of bits per subframe
pointer_to_sf,
subframe,
RB_IoT_ID);
if(RAR->counter_current_sf_repetition == 4)
{
RAR->pointer_to_subframe++;
RAR->counter_current_sf_repetition =0;
if (Nsf == RAR->pointer_to_subframe && (RAR->counter_repetition_number > 4))
{
RAR->counter_repetition_number = RAR->counter_repetition_number-4;
RAR->pointer_to_subframe =0;
RAR->counter_current_sf_repetition =0;
} else {
RAR->active = 0;
done =1;
} }
}
} else {
RAR->counter_current_sf_repetition++; DCI->counter_current_sf_repetition++;
dlsch_modulation_NB_IoT(txdataF, dlsch_modulation_NB_IoT(txdataF,
amp, amp,
frame_parms, frame_parms,
eutro_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) eutro_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
RAR, DCI,
G, // number of bits per subframe G, // number of bits per subframe
pointer_to_sf, pointer_to_sf,
subframe, subframe,
RB_IoT_ID); RB_IoT_ID);
if(RAR->counter_current_sf_repetition == rep) if(DCI->counter_current_sf_repetition == rep)
{ {
RAR->pointer_to_subframe++; DCI->pointer_to_subframe++;
if (Nsf == RAR->pointer_to_subframe) if (Nsf == DCI->pointer_to_subframe)
{ {
RAR->active = 0; DCI->active = 0;
done =1; done =1;
} }
} }
}
} }
return(done); return(done);
} }
*/ */
////////////////////////////////////////////////// backup /////////////////////////// ////////////////////////////////////////////////// backup ///////////////////////////
//////////////////////////////////////////////////// SIB23 //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
/* if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) /* if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{ {
......
...@@ -161,8 +161,6 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -161,8 +161,6 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
eNB->DCI_pdu = (DCI_PDU_NB_IoT*) malloc(sizeof(DCI_PDU_NB_IoT)); eNB->DCI_pdu = (DCI_PDU_NB_IoT*) malloc(sizeof(DCI_PDU_NB_IoT));
//N1 parameters //N1 parameters
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits /// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
......
...@@ -88,6 +88,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -88,6 +88,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
* *
*/ */
//LOG_I(PHY,"B NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n"); //LOG_I(PHY,"B NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n");
ndlsch->active = 1;
ndlsch->rnti = 65535;
ndlsch_harq = ndlsch->harq_process; ndlsch_harq = ndlsch->harq_process;
ndlsch->ndlsch_type = SIB1; ndlsch->ndlsch_type = SIB1;
...@@ -149,6 +153,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -149,6 +153,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
ndlsch23->active = 1; ndlsch23->active = 1;
ndlsch23->ndlsch_type = SI_Message; ndlsch23->ndlsch_type = SI_Message;
ndlsch23->rnti = 65535;
ndlsch23->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission ndlsch23->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
//ndlsch_harq->pdu = sdu; //ndlsch_harq->pdu = sdu;
//LOG_I(PHY,"B content_sib23:%d\n",sdu); //LOG_I(PHY,"B content_sib23:%d\n",sdu);
......
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