Commit 4e62f468 authored by Florian Kaltenberger's avatar Florian Kaltenberger

some more error checking in RRC UE

parent c4121a99
......@@ -448,7 +448,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
//MIB
int32_t MIB_subCarrierSpacingCommon = 0;
int32_t MIB_ssb_SubcarrierOffset = 0;
int32_t MIB_dmrs_TypeA_Position = 0;
int32_t MIB_dmrs_TypeA_Position = 2;
int32_t pdcch_ConfigSIB1 = 0;
//SIB1
......
......@@ -38,6 +38,8 @@
#include "common/utils/LOG/log.h"
#include "openair2/LAYER2/MAC/mac.h"
#define DEBUG_MIB
#include <stdio.h>
#include <math.h>
......@@ -235,7 +237,7 @@ int8_t nr_ue_decode_mib(
nr_mac_rrc_data_ind_ue( module_id, cc_id, gNB_index, NR_BCCH_BCH, (uint8_t *) pduP, 3 ); // fixed 3 bytes MIB PDU
AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n");
//if(mac->mib != NULL){
uint16_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused);
uint16_t frame_number_4lsb = 0;
for (int i=0; i<4; i++)
......@@ -264,7 +266,8 @@ int8_t nr_ue_decode_mib(
LOG_I(MAC,"subcarrier spacing (0=15or60, 1=30or120): %d\n", (int)mac->mib->subCarrierSpacingCommon);
LOG_I(MAC,"ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset);
LOG_I(MAC,"dmrs type A position (0=pos2,1=pos3): %d\n", (int)mac->mib->dmrs_TypeA_Position);
LOG_I(MAC,"pdcch config sib1: %d\n", (int)mac->mib->pdcch_ConfigSIB1);
LOG_I(MAC,"pdcch config sib1 controlResourceSetZero: %d\n", (int)mac->mib->pdcch_ConfigSIB1.controlResourceSetZero);
LOG_I(MAC,"pdcch config sib1 searchSapceZero: %d\n", (int)mac->mib->pdcch_ConfigSIB1.searchSpaceZero);
LOG_I(MAC,"cell barred (0=barred,1=notBarred): %d\n", (int)mac->mib->cellBarred);
LOG_I(MAC,"intra frequency reselection (0=allowed,1=notAllowed): %d\n", (int)mac->mib->intraFreqReselection);
LOG_I(MAC,"half frame bit(extra bits): %d\n", (int)half_frame_bit);
......
......@@ -321,17 +321,23 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
(void **)&bcch_message,
(const void *)bufferP,
buffer_len );
if ((dec_rval.code != RC_OK) || (dec_rval.consumed == 0)) {
printf("NR_BCCH_BCH decode error\n");
printf("NR_BCCH_BCH decode error (return value %d)\n",dec_rval.code);
for (i=0; i<buffer_len; i++){
printf("%02x ",bufferP[i]);
}
printf("\n");
mib = NULL;
// free the memory
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)bcch_message, 1 );
return -1;
}
else if (bcch_message->message.present != NR_BCCH_BCH_MessageType_PR_mib) {
printf("NR_BCCH_BCH message type is not MIB\n");
mib = NULL;
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)bcch_message, 1 );
return -1;
}
else {
// link to rrc instance
mib = bcch_message->message.choice.mib;
......
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