Commit 19af86b1 authored by Laurent THOMAS's avatar Laurent THOMAS

little fixes

parent 89eb5850
......@@ -814,9 +814,8 @@ set(F1AP_ASN_FILES
if (${RU} STREQUAL 0)
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps -Wdebug-compiler -Wdebug-parser" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
RESULT_VARIABLE ret
)
......
......@@ -73,8 +73,6 @@ static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) {
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req) {
F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer=NULL;
uint32_t len=0;
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
......@@ -115,7 +113,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie4->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
ie4->criticality = F1AP_Criticality_reject;
ie4->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
ie4->value.choice.ServCellIndex = 2;
ie4->value.choice.ServCellIndex = 0;
/* optional */
/* c5. CellULConfigured */
......@@ -149,25 +147,23 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* mandatory */
/* c7. Candidate_SpCell_List */
if (0) {
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie7);
ie7->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
ie7->criticality = F1AP_Criticality_ignore;
ie7->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
for (int i=0; i<0; i++) {
asn1cSequenceAdd(ie7->value.choice.Candidate_SpCell_List.list,F1AP_Candidate_SpCell_ItemIEs_t, candidate_spCell_item_ies);
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
candidate_spCell_item_ies->criticality = F1AP_Criticality_reject;
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
/* 7.1 Candidate_SpCell_Item */
F1AP_Candidate_SpCell_Item_t *candidate_spCell_item=
&candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item;
/* - candidate_SpCell_ID */
//FixMe: first cell ???
addnRCGI(candidate_spCell_item->candidate_SpCell_ID,f1ap_ue_context_setup_req);
/* TODO add correct mcc/mnc */
}
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie7);
ie7->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
ie7->criticality = F1AP_Criticality_ignore;
ie7->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ie7->value.choice.Candidate_SpCell_List.list,F1AP_Candidate_SpCell_ItemIEs_t, candidate_spCell_item_ies);
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
candidate_spCell_item_ies->criticality = F1AP_Criticality_reject;
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
/* 7.1 Candidate_SpCell_Item */
F1AP_Candidate_SpCell_Item_t *candidate_spCell_item=
&candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item;
/* - candidate_SpCell_ID */
//FixMe: first cell ???
addnRCGI(candidate_spCell_item->candidate_SpCell_ID,f1ap_ue_context_setup_req);
/* TODO add correct mcc/mnc */
}
/* optional */
......@@ -601,8 +597,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
MaskedIMEISV_TO_BIT_STRING(12340000l, &ie15->value.choice.MaskedIMEISV); // size (64)
}
//xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, &pdu); //(void *)pdu
/* encode */
uint8_t *buffer=NULL;
uint32_t len=0;
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT SETUP REQUEST\n");
return -1;
......
......@@ -47,6 +47,13 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
char errbuf[128]; /* Buffer for error message */
size_t errlen = sizeof(errbuf); /* Size of the buffer */
int ret = asn_check_constraints(&asn_DEF_F1AP_F1AP_PDU, pdu, errbuf, &errlen);
/* assert(errlen < sizeof(errbuf)); // Guaranteed: you may rely on that */
if(ret) {
fprintf(stderr, "Constraint validation failed: %s\n", errbuf);
}
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
......
......@@ -214,7 +214,7 @@ void *gNB_app_task(void *args_p)
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
* can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
if ((AMF_MODE_ENABLED || is_x2ap_enabled()) && !NODE_IS_DU(RC.nrrrc[0]->node_type) && !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
if ((AMF_MODE_ENABLED || is_x2ap_enabled()) && !NODE_IS_DU(RC.nrrrc[0]->node_type) ) { //&& !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
......
......@@ -1351,6 +1351,8 @@ int nr_acknack_scheduling(int mod_id,
/* verify that at that slot and symbol, resources are free. We only do this
* for initialCyclicShift 0 (we assume it always has that one), so other
* initialCyclicShifts can overlap with ICS 0!*/
if (pucch_Config==NULL)
return;
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
if (resource->format.choice.format0->initialCyclicShift == 0) {
......@@ -1387,7 +1389,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
pucch_Config = RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
}
if (pucch_Config == NULL ) continue;
AssertFatal(pucch_Config->schedulingRequestResourceToAddModList->list.count>0,"NO SR configuration available");
for (int SR_resource_id =0; SR_resource_id < pucch_Config->schedulingRequestResourceToAddModList->list.count;SR_resource_id++) {
......
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