Commit 33bd476c authored by Calvin HSU's avatar Calvin HSU

UE: Fixed mac/ue_procedures

parent 3a5f22d9
...@@ -58,32 +58,30 @@ int8_t nr_ue_decode_mib( ...@@ -58,32 +58,30 @@ int8_t nr_ue_decode_mib(
uint32_t half_frame_bit = (uint32_t)(( extra_bits >> 4 ) & 0x1 ); // extra bits[4] uint32_t half_frame_bit = (uint32_t)(( extra_bits >> 4 ) & 0x1 ); // extra bits[4]
uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 5 ) & 0x1 ); // extra bits[5] uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 5 ) & 0x1 ); // extra bits[5]
uint32_t ssb_subcarrier_offset = mac->mib->subCarrierSpacingCommon; uint32_t ssb_subcarrier_offset = mac->mib->ssb_SubcarrierOffset;
uint32_t ssb_index; uint32_t ssb_index = 0;
frame = frame << 4; frame = frame << 4;
frame = frame | frame_number_4lsb; frame = frame | frame_number_4lsb;
if(l_ssb_equal_64){ if(l_ssb_equal_64){
ssb_index = (( extra_bits >> 5 ) & 0x7 ); // extra bits[5:7] ssb_index = (( extra_bits >> 5 ) & 0x7 ); // extra bits[5:7]
mac->phy_config.config_req.pbch_config.ssb_index = ssb_index;
}else{ }else{
if(ssb_subcarrier_offset_msb){ if(ssb_subcarrier_offset_msb){
ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10; ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10;
} }
} }
printf("system frame number(with LSB): %d\n", (int)frame);
printf("subcarrier spacing: %d\n", mac->mib->subCarrierSpacingCommon); printf("subcarrier spacing: %d\n", (int)mac->mib->subCarrierSpacingCommon);
printf("ssb carrier offset: %d\n", ssb_subcarrier_offset); printf("ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset);
printf("dmrs type A position: %d\n", mac->mib->dmrs_TypeA_Position); printf("dmrs type A position: %d\n", (int)mac->mib->dmrs_TypeA_Position);
printf("pdcch config sib1: %d\n", mac->mib->pdcch_ConfigSIB1); printf("pdcch config sib1: %d\n", (int)mac->mib->pdcch_ConfigSIB1);
printf("cell barred: %d\n", mac->mib->cellBarred); printf("cell barred: %d\n", (int)mac->mib->cellBarred);
printf("intra frequcney reselection: %d\n", mac->mib->intraFreqReselection); printf("intra frequcney reselection: %d\n", (int)mac->mib->intraFreqReselection);
printf("system frame number: %d\n", frame); printf("half frame bit(extra bits): %d\n", (int)half_frame_bit);
printf("half frame bit: %d\n", half_frame_bit); printf("ssb index(extra bits): %d\n", (int)ssb_index);
// fill in the elements in config request inside P5 message // fill in the elements in config request inside P5 message
mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation
...@@ -94,6 +92,7 @@ printf("half frame bit: %d\n", half_frame_bit); ...@@ -94,6 +92,7 @@ printf("half frame bit: %d\n", half_frame_bit);
mac->phy_config.config_req.pbch_config.cell_barred = mac->mib->cellBarred; mac->phy_config.config_req.pbch_config.cell_barred = mac->mib->cellBarred;
mac->phy_config.config_req.pbch_config.intra_frequency_reselection = mac->mib->intraFreqReselection; mac->phy_config.config_req.pbch_config.intra_frequency_reselection = mac->mib->intraFreqReselection;
mac->phy_config.config_req.pbch_config.half_frame_bit = half_frame_bit; mac->phy_config.config_req.pbch_config.half_frame_bit = half_frame_bit;
mac->phy_config.config_req.pbch_config.ssb_index = ssb_index;
mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH; mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH;
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL){ if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL){
......
...@@ -300,15 +300,15 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( ...@@ -300,15 +300,15 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
} }
for(i=0; i<4; ++i){ for(i=0; i<buffer_len; ++i){
printf("[RRC] bcch undecod : %d\n", bufferP[i]); printf("[RRC] MIB PDU : %d\n", bufferP[i]);
} }
asn_dec_rval_t dec_rval = uper_decode_complete( NULL, asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_BCCH_BCH_Message, &asn_DEF_NR_BCCH_BCH_Message,
(void **)&bcch_message, (void **)&bcch_message,
(const void *)bufferP[1], (const void *)bufferP,
3//buffer_len buffer_len
); );
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
......
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