Commit 9efdabda authored by matzakos's avatar matzakos

Added On-net UE_STATUS_INFO to notify the application based on the reception...

Added On-net UE_STATUS_INFO to notify the application based on the reception of SL specific RRC messages.
parent 8482a9d6
...@@ -54,20 +54,22 @@ char defbool[2]="1"; ...@@ -54,20 +54,22 @@ char defbool[2]="1";
switch(cfgoptions->type) switch(cfgoptions->type)
{ {
case TYPE_STRING: case TYPE_STRING:
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); /*config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1)); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1));
printf("cfgoptions->strptr %p (&emul_iface %p, emul_iface %p)\n \n \n",cfgoptions->strptr,&emul_iface,emul_iface); printf("cfgoptions->strptr %p (&emul_iface %p, emul_iface %p)\n \n \n",cfgoptions->strptr,&emul_iface,emul_iface);
sprintf(*(cfgoptions->strptr), "%s",tmpval); sprintf((char *)(cfgoptions->strptr), "%s",tmpval);
printf("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); printf("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);*/
/*======= //=======
if (cfgoptions->numelt == 0 ) { if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
sprintf(*(cfgoptions->strptr), "%s",tmpval); sprintf(*(cfgoptions->strptr), "%s",tmpval);
} else { } else {
//sprintf(*(cfgoptions->strptr), "%s",tmpval);
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval); sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
//sprintf( &emul_iface, "%s",tmpval);
} }
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); printf_cmdl("[CONFIG] %s set to %s from command line\n \n \n", cfgoptions->optname, tmpval);
printf("[CONFIG] %s set to %s from command line \n \n \n", cfgoptions->optname, tmpval);
//printf("[CONFIG] %s set to %s from command line \n \n \n", cfgoptions->optname, &emul_iface);
//>>>>>>> main/develop*/ //>>>>>>> main/develop*/
optisset=1; optisset=1;
break; break;
......
...@@ -92,6 +92,7 @@ int ctrl_sock_fd; ...@@ -92,6 +92,7 @@ int ctrl_sock_fd;
struct sockaddr_in prose_app_addr; struct sockaddr_in prose_app_addr;
int slrb_id; int slrb_id;
int send_ue_information = 0; int send_ue_information = 0;
SL_UE_STATE_t On_Off_Net = UE_STATE_OFF_NETWORK;
#endif #endif
#ifdef PHY_EMUL #ifdef PHY_EMUL
...@@ -2196,7 +2197,8 @@ rrc_ue_process_rrcConnectionReconfiguration( ...@@ -2196,7 +2197,8 @@ rrc_ue_process_rrcConnectionReconfiguration(
&& (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12 && (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12
!= NULL)) { != NULL)) {
if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12->commTxResources_r12->present != SL_CommConfig_r12__commTxResources_r12_PR_NOTHING){ if (rrcConnectionReconfiguration_r8->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->sl_CommConfig_r12->commTxResources_r12->present != SL_CommConfig_r12__commTxResources_r12_PR_NOTHING){
LOG_I(RRC,"sl-CommConfig is present\n"); On_Off_Net = UE_STATE_ON_NETWORK;
LOG_I(RRC,"sl-CommConfig is present, UE state: %d \n", On_Off_Net);
//process sl-CommConfig //process sl-CommConfig
rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index, rrc_ue_process_sidelink_radioResourceConfig(ctxt_pP->module_id,eNB_index,
(SystemInformationBlockType18_r12_t *)NULL, (SystemInformationBlockType18_r12_t *)NULL,
...@@ -5667,6 +5669,8 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5667,6 +5669,8 @@ void *rrc_control_socket_thread_fct(void *arg)
//from the main program, listen for the incoming messages from control socket (ProSe App) //from the main program, listen for the incoming messages from control socket (ProSe App)
prose_addr_len = sizeof(prose_app_addr); prose_addr_len = sizeof(prose_app_addr);
//int enable_notification = 1; //int enable_notification = 1;
LOG_I(RRC,"UE SL state: %d \n", On_Off_Net);
while (1) { while (1) {
LOG_I(RRC,"Listening to incoming connection from ProSe App \n"); LOG_I(RRC,"Listening to incoming connection from ProSe App \n");
// receive a message from ProSe App // receive a message from ProSe App
...@@ -5696,7 +5700,8 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5696,7 +5700,8 @@ void *rrc_control_socket_thread_fct(void *arg)
sl_ctrl_msg_send = calloc(1, sizeof(struct sidelink_ctrl_element)); sl_ctrl_msg_send = calloc(1, sizeof(struct sidelink_ctrl_element));
sl_ctrl_msg_send->type = UE_STATUS_INFO; sl_ctrl_msg_send->type = UE_STATUS_INFO;
sl_ctrl_msg_send->sidelinkPrimitive.ue_state = UE_STATE_OFF_NETWORK; //off-network sl_ctrl_msg_send->sidelinkPrimitive.ue_state = On_Off_Net;
//sl_ctrl_msg_send->sidelinkPrimitive.ue_state = UE_STATE_OFF_NETWORK; //off-network
memcpy((void *)send_buf, (void *)sl_ctrl_msg_send, sizeof(struct sidelink_ctrl_element)); memcpy((void *)send_buf, (void *)sl_ctrl_msg_send, sizeof(struct sidelink_ctrl_element));
free(sl_ctrl_msg_send); free(sl_ctrl_msg_send);
......
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
{"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:(char **)&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:0, TYPE_UINT8, 0}, \
{"D2D-emul", NULL, 0, u8ptr:&D2D_en, defuintval:0, TYPE_UINT8, 0}, \ {"D2D-emul", NULL, 0, u8ptr:&D2D_en, defuintval:0, TYPE_UINT8, 0}, \
{"num-ues", NULL, 0, u8ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT8, 0}, \ {"num-ues", NULL, 0, u8ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT8, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0} \ {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0} \
......
...@@ -308,9 +308,10 @@ void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, ...@@ -308,9 +308,10 @@ void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in,
printf("UE threads created \n"); printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface); LOG_I(PHY,"Starting multicast link on %s\n", emul_iface);
//if(nfapi_mode !=3) //This has to change now. It should be active for the case of D2D On-net //if(nfapi_mode !=3) //This has to change now. It should be active for the case of D2D On-net
multicast_link_start(ue_stub_rx_handler,0,emul_iface); if(D2D_en)
multicast_link_start(ue_stub_rx_handler,0, emul_iface);
} }
...@@ -344,9 +345,10 @@ void init_UE_stub(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_ifa ...@@ -344,9 +345,10 @@ void init_UE_stub(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_ifa
printf("UE threads created \n"); printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface); LOG_I(PHY,"Starting multicast link on %s\n", &emul_iface);
//if(nfapi_mode !=3) //This has to change now. It should be active for the case of D2D On-net //if(nfapi_mode !=3) //This has to change now. It should be active for the case of D2D On-net
multicast_link_start(ue_stub_rx_handler,0,emul_iface); if(D2D_en)
multicast_link_start(ue_stub_rx_handler,0, &emul_iface);
......
...@@ -1186,7 +1186,8 @@ int main( int argc, char **argv ) ...@@ -1186,7 +1186,8 @@ int main( int argc, char **argv )
wait_nfapi_init("main?"); wait_nfapi_init("main?");
//Panos: Temporarily we will be using single set of threads for multiple UEs. //Panos: Temporarily we will be using single set of threads for multiple UEs.
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface); //init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface); //LOG_I(MAC, "Panos-D: Interface name: %s", &emul_iface);
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,&emul_iface);
} }
else { else {
init_UE(1,eMBMS_active,uecap_xer_in,0); init_UE(1,eMBMS_active,uecap_xer_in,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