Commit e9e6e77f authored by Lionel Gauthier's avatar Lionel Gauthier

Updates, less bugs

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4850 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c2018916
...@@ -47,8 +47,10 @@ ...@@ -47,8 +47,10 @@
#define DEFAULT_ADDRESS_3GPP "0335060080149150" #define DEFAULT_ADDRESS_3GPP "0335060080149150"
#define DEFAULT_ADDRESS_eNB "0000000000000001" #define DEFAULT_ADDRESS_eNB "0000000000000001"
#define USE_3GPP_ADDR_AS_LINK_ADDR 1
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Constants for scenario // Constants for scenario
#define PREDEFINED_MIH_PLMN_ID 503
#define PREDEFINED_MIH_NETWORK_ID "eurecom" #define PREDEFINED_MIH_NETWORK_ID "eurecom"
#define PREDEFINED_MIH_NETAUX_ID "netaux" #define PREDEFINED_MIH_NETAUX_ID "netaux"
......
...@@ -62,9 +62,15 @@ ...@@ -62,9 +62,15 @@
public_mRAL_mih_msg( int mRAL_send_to_mih(ral_ue_instance_t instanceP, u_int8_t *bufferP, size_t lenP);) public_mRAL_mih_msg( int mRAL_send_to_mih(ral_ue_instance_t instanceP, u_int8_t *bufferP, size_t lenP);)
protected_mRAL_mih_msg( int mRAL_mihf_connect (ral_ue_instance_t instanceP);) protected_mRAL_mih_msg( int mRAL_mihf_connect (ral_ue_instance_t instanceP);)
protected_mRAL_mih_msg( void MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_ue_instance_t instanceP, \
MIH_C_3GPP_ADDR_T* _3gpp_addrP, \
u_int8_t* strP);)
protected_mRAL_mih_msg( void mRAL_send_link_register_indication (\ protected_mRAL_mih_msg( void mRAL_send_link_register_indication (\
ral_ue_instance_t instanceP,\ ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP);) MIH_C_TRANSACTION_ID_T *transaction_idP);)
protected_mRAL_mih_msg( void mRAL_send_link_detected_indication (\ protected_mRAL_mih_msg( void mRAL_send_link_detected_indication (\
ral_ue_instance_t instanceP,\ ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\ MIH_C_TRANSACTION_ID_T *transaction_idP,\
...@@ -142,5 +148,6 @@ protected_mRAL_mih_msg( void mRAL_send_get_parameters_confirm (\ ...@@ -142,5 +148,6 @@ protected_mRAL_mih_msg( void mRAL_send_get_parameters_confirm (\
private_mRAL_mih_msg( int mRAL_mih_link_msg_decode (\ private_mRAL_mih_msg( int mRAL_mih_link_msg_decode (\
ral_ue_instance_t instanceP,\ ral_ue_instance_t instanceP,\
Bit_Buffer_t* bbP, MIH_C_Message_Wrapper_t *message_wrapperP);) Bit_Buffer_t* bbP, MIH_C_Message_Wrapper_t *message_wrapperP);)
protected_mRAL_mih_msg( int mRAL_mih_link_process_message (ral_ue_instance_t instanceP);) protected_mRAL_mih_msg( int mRAL_mih_link_process_message (ral_ue_instance_t instanceP);)
#endif #endif
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include "lteRALue.h" #include "lteRALue.h"
#include "intertask_interface.h" #include "intertask_interface.h"
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_scan_confirm (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_system_information_indication (instance_t instance, MessageDef *msg_p);) protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_system_information_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_establishment_indication (instance_t instance, MessageDef *msg_p);) protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_establishment_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_reestablishment_indication (instance_t instance, MessageDef *msg_p);) protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_reestablishment_indication (instance_t instance, MessageDef *msg_p);)
......
...@@ -46,10 +46,13 @@ ...@@ -46,10 +46,13 @@
#include <time.h> #include <time.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lteRALue.h" #include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
#include "intertask_interface.h" #include "intertask_interface.h"
#include "OCG.h" #include "OCG.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern OAI_Emulation oai_emulation; extern OAI_Emulation oai_emulation;
...@@ -156,7 +159,11 @@ void mRAL_get_IPv6_addr(void) { ...@@ -156,7 +159,11 @@ void mRAL_get_IPv6_addr(void) {
} }
} }
void mRAL_init_default_values(void) {
//---------------------------------------------------------------------------
void mRAL_init_default_values(void)
//---------------------------------------------------------------------------
{
g_conf_ue_ral_listening_port = UE_DEFAULT_LOCAL_PORT_RAL; g_conf_ue_ral_listening_port = UE_DEFAULT_LOCAL_PORT_RAL;
g_conf_ue_ral_ip_address = UE_DEFAULT_IP_ADDRESS_RAL; g_conf_ue_ral_ip_address = UE_DEFAULT_IP_ADDRESS_RAL;
g_conf_ue_ral_link_id = UE_DEFAULT_LINK_ID_RAL; g_conf_ue_ral_link_id = UE_DEFAULT_LINK_ID_RAL;
...@@ -170,6 +177,7 @@ void mRAL_init_default_values(void) { ...@@ -170,6 +177,7 @@ void mRAL_init_default_values(void) {
int mRAL_initialize(void) { int mRAL_initialize(void) {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
ral_ue_instance_t instance = 0; ral_ue_instance_t instance = 0;
unsigned int mod_id = 0;
char *char_tmp = NULL; char *char_tmp = NULL;
MIH_C_init(); MIH_C_init();
...@@ -180,34 +188,36 @@ int mRAL_initialize(void) { ...@@ -180,34 +188,36 @@ int mRAL_initialize(void) {
g_ue_ral_fd2instance = hashtable_create (32, NULL, hash_free_int_func); g_ue_ral_fd2instance = hashtable_create (32, NULL, hash_free_int_func);
for (instance = 0; instance < oai_emulation.info.nb_ue_local; instance++) { for (mod_id = 0; mod_id < oai_emulation.info.nb_ue_local; mod_id++) {
char_tmp = calloc(1, strlen(g_conf_ue_ral_listening_port) + 3); // 2 digits + \0 ->99 instances
sprintf(char_tmp,"%d", atoi(g_conf_ue_ral_listening_port) + instance); instance = mod_id + NB_eNB_INST;
g_ue_ral_obj[instance].ral_listening_port = char_tmp; char_tmp = calloc(1, strlen(g_conf_ue_ral_listening_port) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp,"%d", atoi(g_conf_ue_ral_listening_port) + mod_id);
g_ue_ral_obj[mod_id].ral_listening_port = char_tmp;
g_ue_ral_obj[instance].ral_ip_address = strdup(g_conf_ue_ral_ip_address); g_ue_ral_obj[mod_id].ral_ip_address = strdup(g_conf_ue_ral_ip_address);
g_ue_ral_obj[instance].ral_link_address = strdup(g_conf_ue_ral_link_address); g_ue_ral_obj[mod_id].ral_link_address = strdup(g_conf_ue_ral_link_address);
char_tmp = calloc(1, strlen(g_conf_ue_mihf_remote_port) + 3); // 2 digits + \0 ->99 instances char_tmp = calloc(1, strlen(g_conf_ue_mihf_remote_port) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%d", atoi(g_conf_ue_mihf_remote_port) + instance); sprintf(char_tmp, "%d", atoi(g_conf_ue_mihf_remote_port) + mod_id);
g_ue_ral_obj[instance].mihf_remote_port = char_tmp; g_ue_ral_obj[mod_id].mihf_remote_port = char_tmp;
g_ue_ral_obj[instance].mihf_ip_address = strdup(g_conf_ue_mihf_ip_address); g_ue_ral_obj[mod_id].mihf_ip_address = strdup(g_conf_ue_mihf_ip_address);
char_tmp = calloc(1, strlen(g_conf_ue_mihf_id) + 3); // 2 digits + \0 ->99 instances char_tmp = calloc(1, strlen(g_conf_ue_mihf_id) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%s%02d",g_conf_ue_mihf_id, instance); sprintf(char_tmp, "%s%02d",g_conf_ue_mihf_id, mod_id);
g_ue_ral_obj[instance].mihf_id = char_tmp; g_ue_ral_obj[mod_id].mihf_id = char_tmp;
char_tmp = calloc(1, strlen(g_conf_ue_ral_link_id) + 3); // 2 digits + \0 ->99 instances char_tmp = calloc(1, strlen(g_conf_ue_ral_link_id) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%s%02d",g_conf_ue_ral_link_id, instance); sprintf(char_tmp, "%s%02d",g_conf_ue_ral_link_id, mod_id);
g_ue_ral_obj[instance].link_id = char_tmp; g_ue_ral_obj[mod_id].link_id = char_tmp;
char_tmp = NULL; char_tmp = NULL;
printf("g_ue_ral_obj[%d].link_id=%s\n", instance, g_ue_ral_obj[instance].link_id); printf("g_ue_ral_obj[%d].link_id=%s\n", mod_id, g_ue_ral_obj[mod_id].link_id);
// excluded MIH_C_LINK_AC_TYPE_NONE // excluded MIH_C_LINK_AC_TYPE_NONE
// excluded MIH_C_LINK_AC_TYPE_LINK_LOW_POWER // excluded MIH_C_LINK_AC_TYPE_LINK_LOW_POWER
g_ue_ral_obj[instance].mih_supported_action_list = MIH_C_LINK_AC_TYPE_LINK_DISCONNECT | g_ue_ral_obj[mod_id].mih_supported_action_list = MIH_C_LINK_AC_TYPE_LINK_DISCONNECT |
MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN | MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN |
MIH_C_LINK_AC_TYPE_LINK_POWER_UP | MIH_C_LINK_AC_TYPE_LINK_POWER_UP |
MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR | MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR |
...@@ -216,7 +226,7 @@ int mRAL_initialize(void) { ...@@ -216,7 +226,7 @@ int mRAL_initialize(void) {
g_ue_ral_obj[instance].mih_supported_link_event_list = MIH_C_BIT_LINK_DETECTED | g_ue_ral_obj[mod_id].mih_supported_link_event_list = MIH_C_BIT_LINK_DETECTED |
MIH_C_BIT_LINK_UP | MIH_C_BIT_LINK_UP |
MIH_C_BIT_LINK_DOWN | MIH_C_BIT_LINK_DOWN |
MIH_C_BIT_LINK_PARAMETERS_REPORT | MIH_C_BIT_LINK_PARAMETERS_REPORT |
...@@ -225,33 +235,33 @@ int mRAL_initialize(void) { ...@@ -225,33 +235,33 @@ int mRAL_initialize(void) {
MIH_C_BIT_LINK_HANDOVER_COMPLETE | MIH_C_BIT_LINK_HANDOVER_COMPLETE |
MIH_C_BIT_LINK_PDU_TRANSMIT_STATUS; MIH_C_BIT_LINK_PDU_TRANSMIT_STATUS;
g_ue_ral_obj[instance].mih_supported_link_command_list = MIH_C_BIT_LINK_EVENT_SUBSCRIBE | MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE | g_ue_ral_obj[mod_id].mih_supported_link_command_list = MIH_C_BIT_LINK_EVENT_SUBSCRIBE | MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE |
MIH_C_BIT_LINK_GET_PARAMETERS | MIH_C_BIT_LINK_CONFIGURE_THRESHOLDS | MIH_C_BIT_LINK_GET_PARAMETERS | MIH_C_BIT_LINK_CONFIGURE_THRESHOLDS |
MIH_C_BIT_LINK_ACTION; MIH_C_BIT_LINK_ACTION;
g_ue_ral_obj[instance].link_to_be_detected = MIH_C_BOOLEAN_TRUE; g_ue_ral_obj[mod_id].link_to_be_detected = MIH_C_BOOLEAN_TRUE;
g_ue_ral_obj[instance].link_mihcap_flag = MIH_C_BIT_EVENT_SERVICE_SUPPORTED | MIH_C_BIT_COMMAND_SERVICE_SUPPORTED | MIH_C_BIT_INFORMATION_SERVICE_SUPPORTED; g_ue_ral_obj[mod_id].link_mihcap_flag = MIH_C_BIT_EVENT_SERVICE_SUPPORTED | MIH_C_BIT_COMMAND_SERVICE_SUPPORTED | MIH_C_BIT_INFORMATION_SERVICE_SUPPORTED;
g_ue_ral_obj[instance].net_caps = MIH_C_BIT_NET_CAPS_QOS_CLASS5 | MIH_C_BIT_NET_CAPS_INTERNET_ACCESS | MIH_C_BIT_NET_CAPS_MIH_CAPABILITY; g_ue_ral_obj[mod_id].net_caps = MIH_C_BIT_NET_CAPS_QOS_CLASS5 | MIH_C_BIT_NET_CAPS_INTERNET_ACCESS | MIH_C_BIT_NET_CAPS_MIH_CAPABILITY;
g_ue_ral_obj[instance].transaction_id = (MIH_C_TRANSACTION_ID_T)rand(); g_ue_ral_obj[mod_id].transaction_id = (MIH_C_TRANSACTION_ID_T)rand();
LOG_D(RAL_UE, " Connect to the MIH-F for instance %d...\n", instance); LOG_D(RAL_UE, " Connect to the MIH-F for module id instance %d...\n", mod_id, instance);
g_ue_ral_obj[instance].mih_sock_desc = -1; g_ue_ral_obj[mod_id].mih_sock_desc = -1;
if (mRAL_mihf_connect(instance) < 0 ) { if (mRAL_mihf_connect(instance) < 0 ) {
LOG_E(RAL_UE, " %s : Could not connect to MIH-F...\n", __FUNCTION__); LOG_E(RAL_UE, " %s : Could not connect to MIH-F...\n", __FUNCTION__);
// TO DO RETRY LATER // TO DO RETRY LATER
//exit(-1); //exit(-1);
} else { } else {
itti_subscribe_event_fd(TASK_RAL_UE, g_ue_ral_obj[instance].mih_sock_desc); itti_subscribe_event_fd(TASK_RAL_UE, g_ue_ral_obj[mod_id].mih_sock_desc);
hashtable_insert(g_ue_ral_fd2instance, g_ue_ral_obj[instance].mih_sock_desc, (void*)instance); hashtable_insert(g_ue_ral_fd2instance, g_ue_ral_obj[mod_id].mih_sock_desc, (void*)instance);
} }
mRAL_send_link_register_indication(instance, &g_ue_ral_obj[instance].transaction_id); mRAL_send_link_register_indication(instance, &g_ue_ral_obj[mod_id].transaction_id);
} }
return 0; return 0;
} }
...@@ -286,6 +296,15 @@ void* mRAL_task(void *args_p) { ...@@ -286,6 +296,15 @@ void* mRAL_task(void *args_p) {
itti_mark_task_ready (TASK_RAL_UE); itti_mark_task_ready (TASK_RAL_UE);
// Set UE activation state
for (instance = NB_eNB_INST; instance < (NB_eNB_INST + NB_UE_INST); instance++)
{
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_RAL_UE, DEACTIVATE_MESSAGE);
itti_send_msg_to_task(TASK_L2L1, instance, message_p);
}
while(1) { while(1) {
// Wait for a message // Wait for a message
itti_receive_msg (TASK_RAL_UE, &msg_p); itti_receive_msg (TASK_RAL_UE, &msg_p);
...@@ -305,6 +324,11 @@ void* mRAL_task(void *args_p) { ...@@ -305,6 +324,11 @@ void* mRAL_task(void *args_p) {
LOG_D(RAL_UE, "Received %s\n", msg_name); LOG_D(RAL_UE, "Received %s\n", msg_name);
break; break;
case RRC_RAL_SCAN_CONF:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_scan_confirm(instance, msg_p);
break;
case RRC_RAL_SYSTEM_INFORMATION_IND: case RRC_RAL_SYSTEM_INFORMATION_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name); LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_system_information_indication(instance, msg_p); mRAL_rx_rrc_ral_system_information_indication(instance, msg_p);
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lteRALue.h" #include "lteRALue.h"
#include "PHY/extern.h"
/* /*
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Temp - Enter hard-coded measures in IAL // Temp - Enter hard-coded measures in IAL
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define LTERALUE_SUBSCRIBE_C #define LTERALUE_SUBSCRIBE_C
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lteRALue.h" #include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
/****************************************************************************/ /****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/ /****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/ /****************************************************************************/
...@@ -60,15 +61,16 @@ ...@@ -60,15 +61,16 @@
***************************************************************************/ ***************************************************************************/
void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP) void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP)
{ {
unsigned int mod_id = instanceP - NB_eNB_INST;
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED; MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
/* Check whether the action request is supported */ /* Check whether the action request is supported */
if (g_ue_ral_obj[instanceP].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_SUBSCRIBE) if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_SUBSCRIBE)
{ {
MIH_C_LINK_EVENT_LIST_T mih_subscribed_req_event_list; MIH_C_LINK_EVENT_LIST_T mih_subscribed_req_event_list;
g_ue_ral_obj[instanceP].mih_subscribe_req_event_list |= (msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[instanceP].mih_supported_link_event_list); g_ue_ral_obj[mod_id].mih_subscribe_req_event_list |= (msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_subscribed_req_event_list = g_ue_ral_obj[instanceP].mih_subscribe_req_event_list & msgP->primitive.RequestedLinkEventList; mih_subscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list & msgP->primitive.RequestedLinkEventList;
status = MIH_C_STATUS_SUCCESS; status = MIH_C_STATUS_SUCCESS;
...@@ -103,16 +105,18 @@ void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Even ...@@ -103,16 +105,18 @@ void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Even
void mRAL_unsubscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP) void mRAL_unsubscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP)
{ {
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED; MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
unsigned int mod_id = instanceP - NB_eNB_INST;
/* Check whether the action request is supported */ /* Check whether the action request is supported */
if (g_ue_ral_obj[instanceP].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE) if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE)
{ {
MIH_C_LINK_EVENT_LIST_T mih_unsubscribed_req_event_list; MIH_C_LINK_EVENT_LIST_T mih_unsubscribed_req_event_list;
MIH_C_LINK_EVENT_LIST_T saved_req_event_list; MIH_C_LINK_EVENT_LIST_T saved_req_event_list;
saved_req_event_list = g_ue_ral_obj[instanceP].mih_subscribe_req_event_list; saved_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list;
g_ue_ral_obj[instanceP].mih_subscribe_req_event_list &= ~(msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[instanceP].mih_supported_link_event_list); g_ue_ral_obj[mod_id].mih_subscribe_req_event_list &= ~(msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_unsubscribed_req_event_list = g_ue_ral_obj[instanceP].mih_subscribe_req_event_list ^ saved_req_event_list; mih_unsubscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list ^ saved_req_event_list;
status = MIH_C_STATUS_SUCCESS; status = MIH_C_STATUS_SUCCESS;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#define LTE_RAL_UE #define LTE_RAL_UE
#define LTERALUE_THRESHOLDS_C #define LTERALUE_THRESHOLDS_C
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "assertions.h"
#include "lteRALue.h" #include "lteRALue.h"
...@@ -62,6 +63,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag ...@@ -62,6 +63,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag
unsigned int th_index; unsigned int th_index;
rrc_ral_configure_threshold_req_t configure_threshold_req; rrc_ral_configure_threshold_req_t configure_threshold_req;
MessageDef *message_p; MessageDef *message_p;
MIH_C_STATUS_T status;
MIH_C_STATUS_T global_status;
int result;
MIH_C_LINK_CFG_STATUS_LIST_T link_configure_status_list;
MIH_C_LINK_CFG_STATUS_LIST_init(&link_configure_status_list);
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONFIGURE_THRESHOLD_REQ); message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONFIGURE_THRESHOLD_REQ);
...@@ -70,8 +77,13 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag ...@@ -70,8 +77,13 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag
// copy transaction id // copy transaction id
configure_threshold_req.transaction_id = msgP->header.transaction_id; configure_threshold_req.transaction_id = msgP->header.transaction_id;
global_status = MIH_C_STATUS_SUCCESS;
// configure_threshold_req.num_link_cfg_params = 0; // done // configure_threshold_req.num_link_cfg_params = 0; // done
for (index = 0; index < msgP->primitive.LinkConfigureParameterList_list.length; index++) { for (index = 0; index < msgP->primitive.LinkConfigureParameterList_list.length; index++) {
status = MIH_C_STATUS_SUCCESS;
// copy link_param_type // copy link_param_type
configure_threshold_req.link_cfg_params[index].link_param_type.choice = msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type.choice; configure_threshold_req.link_cfg_params[index].link_param_type.choice = msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type.choice;
switch (configure_threshold_req.link_cfg_params[index].link_param_type.choice) { switch (configure_threshold_req.link_cfg_params[index].link_param_type.choice) {
...@@ -91,8 +103,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag ...@@ -91,8 +103,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag
sizeof(ral_link_param_lte_t)); sizeof(ral_link_param_lte_t));
break; break;
default: default:
assert(1==0); status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
break;
} }
// at first error, exit
configure_threshold_req.num_link_cfg_params += 1; configure_threshold_req.num_link_cfg_params += 1;
// copy choice // copy choice
...@@ -105,8 +121,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag ...@@ -105,8 +121,12 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag
break; break;
case RAL_LINK_CFG_PARAM_CHOICE_TIMER: case RAL_LINK_CFG_PARAM_CHOICE_TIMER:
configure_threshold_req.link_cfg_params[index]._union.timer_interval = msgP->primitive.LinkConfigureParameterList_list.val[index]._union.timer_interval; configure_threshold_req.link_cfg_params[index]._union.timer_interval = msgP->primitive.LinkConfigureParameterList_list.val[index]._union.timer_interval;
break;
default: default:
assert(1==0); printf("ERROR RAL_UE, : mRAL_configure_thresholds_request unknown configure_threshold_req.link_cfg_params[index].union_choice %d\n",
configure_threshold_req.link_cfg_params[index].union_choice);
status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
break;
} }
// copy th_action // copy th_action
...@@ -117,12 +137,44 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag ...@@ -117,12 +137,44 @@ void mRAL_configure_thresholds_request(ral_ue_instance_t instanceP, MIH_C_Messag
configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_val = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_val; configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_val = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_val;
configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_xdir = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_xdir; configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_xdir = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_xdir;
configure_threshold_req.link_cfg_params[index].num_thresholds += 1; configure_threshold_req.link_cfg_params[index].num_thresholds += 1;
// Fill ConfigureThreshold_confirm
if (link_configure_status_list.length < MIH_C_LINK_CFG_STATUS_LIST_LENGTH) {
memcpy(&link_configure_status_list.val[link_configure_status_list.length].link_param_type,
&configure_threshold_req.link_cfg_params[index].link_param_type,
sizeof(ral_link_param_type_t));
memcpy(&link_configure_status_list.val[link_configure_status_list.length].threshold,
&msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index],
sizeof(ral_link_param_type_t));
link_configure_status_list.val[link_configure_status_list.length].config_status = status;
link_configure_status_list.length += 1;
} else {
LOG_E(RAL_UE, "MIH_C_LINK_CFG_STATUS_LIST overflow for send_configure_thresholds_confirm\n");
global_status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
}
} }
} }
if (link_configure_status_list.length > 0) {
memcpy (&message_p->ittiMsg, (void *) &configure_threshold_req, sizeof(rrc_ral_configure_threshold_req_t)); memcpy (&message_p->ittiMsg, (void *) &configure_threshold_req, sizeof(rrc_ral_configure_threshold_req_t));
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p); itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
mRAL_send_configure_thresholds_confirm(instanceP,
&msgP->header.transaction_id,
&global_status,
&link_configure_status_list);
} else {
mRAL_send_configure_thresholds_confirm(instanceP,
&msgP->header.transaction_id,
&global_status,
NULL);
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
......
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