uint8_tNsf,// number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsignedintG,// G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
time_stats_t*rm_stats,
time_stats_t*te_stats,
time_stats_t*i_stats){
uint32_tcrc=1;
//unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h
//uint8_t option1,option2,option3,option4;
unsignedintA=0;
A=dlsch->harq_process->TBS/8;
uint8_tRCC;
uint8_tnpbch_a[A];
uint8_tnpbch_a_crc[A+3];
bzero(npbch_a,A);
bzero(npbch_a_crc,A+3);
dlsch->harq_process->length_e=G*Nsf;// G*Nsf (number_of_subframes) = total number of bits to transmit G=236
for(inti=0;i<A;i++)
{
npbch_a[i]=a[i];
}
int32_tnumbits=(A*8)+24;
crc=crc24a_NB_IoT(npbch_a,A*8)>>8;
for(intj=0;j<A;j++)
{
npbch_a_crc[j]=npbch_a[j];
}
npbch_a_crc[A]=((uint8_t*)&crc)[2];
npbch_a_crc[A+1]=((uint8_t*)&crc)[1];
npbch_a_crc[A+2]=((uint8_t*)&crc)[0];
dlsch->harq_process->B=numbits;// The length of table b in bits
//memcpy(dlsch->b,a,numbits/8); // comment if option 2