Commit 3b335e1d authored by vettel's avatar vettel

sync

parent 7dc6ebf4
......@@ -168,7 +168,7 @@ typedef struct x2ap_handover_req_ack_s {
int source_x2id; /* TODO: to be fixed/remove */
/* TODO: this parameter has to be removed */
int target_mod_id;
uint8_t rrc_buffer[255 /* TODO: should be RRC_BUF_SIZE */];
uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
int rrc_buffer_size;
} x2ap_handover_req_ack_t;
......
......@@ -58,6 +58,7 @@
#include "RRCConnectionSetup.h"
#include "SRB-ToAddModList.h"
#include "DRB-ToAddModList.h"
#include "HandoverCommand.h"
#if defined(Rel10) || defined(Rel14)
#include "MCCH-Message.h"
//#define MRB1 1
......@@ -2600,6 +2601,32 @@ uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t
return encoded;
}
int do_HandoverCommand(char *ho_buf, int ho_size, char *rrc_buf, int rrc_size)
{
asn_enc_rval_t enc_rval;
HandoverCommand_t ho;
memset(&ho, 0, sizeof(ho));
ho.criticalExtensions.present = HandoverCommand__criticalExtensions_PR_c1;
ho.criticalExtensions.choice.c1.present = HandoverCommand__criticalExtensions__c1_PR_handoverCommand_r8;
if (OCTET_STRING_fromBuf(
&ho.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage,
rrc_buf, rrc_size) == -1) { printf("%s:%d: fatal: OCTET_STRING_fromBuf failed\n"); abort(); }
enc_rval = uper_encode_to_buffer(&asn_DEF_HandoverCommand,
&ho,
ho_buf,
ho_size);
/* TODO: free the OCTET_STRING */
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return((enc_rval.encoded+7)/8);
}
OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
{
static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */
......
......@@ -258,6 +258,8 @@ uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t trans
uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer);
int do_HandoverCommand(char *ho_buf, int ho_size, char *rrc_buf, int rrc_size);
OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer);
uint8_t
......
......@@ -3158,7 +3158,7 @@ rrc_eNB_generate_handover_reconfiguration(
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH =
CALLOC(1, sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH));
physicalConfigDedicated2->cqi_ReportConfig = NULL; //CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL; //CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
physicalConfigDedicated2->antennaInfo = CALLOC(1, sizeof(*physicalConfigDedicated2->antennaInfo));
physicalConfigDedicated2->schedulingRequestConfig =
CALLOC(1, sizeof(*physicalConfigDedicated2->schedulingRequestConfig));
......@@ -3700,7 +3700,8 @@ rrc_eNB_generate_handover_reconfiguration(
mobilityInfo = CALLOC(1, sizeof(*mobilityInfo));
memset((void *)mobilityInfo, 0, sizeof(*mobilityInfo));
mobilityInfo->targetPhysCellId = 0;
mobilityInfo->targetPhysCellId = rrc_inst->configuration.cell_identity;
//(PhysCellId_t) two_tier_hexagonal_cellIds[ue_context_pP->ue_context.handover_info->modid_t];
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: targetPhysCellId: %ld mod_id: %d ue: %x \n",
ctxt_pP->module_id,
......@@ -3782,6 +3783,7 @@ rrc_eNB_generate_handover_reconfiguration(
// store the srb and drb list for ho management, mainly in case of failure
#if 0
memcpy(ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.srb_ToAddModList,
(void*)SRB_configList2,
sizeof(SRB_ToAddModList_t));
......@@ -3795,6 +3797,8 @@ rrc_eNB_generate_handover_reconfiguration(
memcpy((void*)ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.physicalConfigDedicated,
(void*)ue_context_pP->ue_context.physicalConfigDedicated,
sizeof(PhysicalConfigDedicated_t));
#endif
/* memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.sps_Config,
(void *)rrc_inst->sps_Config[ue_mod_idP],
sizeof(SPS_Config_t));
......@@ -3845,9 +3849,11 @@ rrc_eNB_generate_handover_reconfiguration(
// rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->reportConfigToAddModList = ReportConfig_list;
memset(buffer, 0, RRC_BUF_SIZE);
size = do_RRCConnectionReconfiguration(
char rrc_buf[1000 /* arbitrary, should be big enough, has to be less than size of return buf by a few bits/bytes */];
int rrc_size;
rrc_size = do_RRCConnectionReconfiguration(
ctxt_pP,
buffer,
(unsigned char *)rrc_buf,
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), //Transaction_id,
SRB_configList2,
DRB_configList2,
......@@ -3870,7 +3876,16 @@ rrc_eNB_generate_handover_reconfiguration(
#endif
);
*_size = size;
if (rrc_size <= 0) { printf("%s:%d: fatal\n", __FILE__, __LINE__); abort(); }
char *ho_buf = (char*)buffer;
int ho_size;
ho_size = do_HandoverCommand(
ho_buf, 1024 /* TODO: this is the value found in struct x2ap_handover_req_ack_s for array rrc_buffer */,
rrc_buf,
rrc_size);
*_size = size = ho_size;
LOG_I(RRC,
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration for handover (bytes %d, UE rnti %x)\n",
......
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