Commit acc57964 authored by matzakos's avatar matzakos

Minor modifications to ensure that both D2D and nfapi-L2-emulator work fine individually.

parent cd35f606
......@@ -56,7 +56,7 @@ char defbool[2]="1";
case TYPE_STRING:
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1));
printf("cfgoptions->strptr %p (&emul_iface %p, emul_iface %p)\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);
printf("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
/*=======
......@@ -64,10 +64,11 @@ char defbool[2]="1";
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
sprintf(*(cfgoptions->strptr), "%s",tmpval);
} else {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
//sprintf(*(cfgoptions->strptr), "%s",tmpval);
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
}
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
>>>>>>> main/develop*/
//>>>>>>> main/develop*/
optisset=1;
break;
......
......@@ -2341,6 +2341,7 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
SLDCH_t *sldch;
SLSCH_t *slsch;
LOG_D(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
// check for SLBCH/SLSS
......
......@@ -74,7 +74,6 @@ extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
extern uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset);
extern int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
extern uint8_t nfapi_mode;
extern uint8_t nfapi_mode;
......
......@@ -52,7 +52,9 @@ Description Implements the API used by the NAS layer to read/write
* Subscriber authentication security key
*/
#define USIM_API_K_SIZE 16
#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
//#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
#define USIM_API_K_VALUE "8baf473f2f8fd09487cccbd7097c6862"
/*
* The name of the file where are stored data of the USIM application
......
......@@ -139,6 +139,7 @@
{"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}, \
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, 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}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0} \
}
......
......@@ -63,6 +63,7 @@
extern double cpuf;
extern uint8_t nfapi_mode;
extern uint8_t D2D_en;
#define FRAME_PERIOD 100000000ULL
#define DAQ_PERIOD 66667ULL
......@@ -308,7 +309,7 @@ void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in,
printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
if(nfapi_mode!=3)
//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);
......@@ -344,7 +345,7 @@ void init_UE_stub(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_ifa
printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
if(nfapi_mode !=3)
//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);
......@@ -892,7 +893,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
hi_dci0_req = NULL;
tx_request_pdu_list = NULL;
PHY_VARS_UE *UE; //= rtd->UE;
PHY_VARS_UE *UE; //= rtd->UE;
int ret;
// double t_diff;
......@@ -1002,7 +1003,10 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
hi_dci0_req_UE_MAC(hi_dci0_req, Mod_id);
}
if(nfapi_mode!=3)
//Panos: Have to remove this now that we run both D2D and nfapi-L2-emulator.
//Currently the call to this function creates problems for the RRC Connection establishment for
//if running with more than one UEs
//if(nfapi_mode!=3)
phy_procedures_UE_SL_TX(UE,proc);
}
......@@ -1295,7 +1299,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
hi_dci0_req = NULL;
}
if (nfapi_mode != 3)
//if (nfapi_mode != 3)
phy_procedures_UE_SL_TX(UE,proc);
}
......@@ -2068,7 +2072,8 @@ static void* timer_thread( void* param ) {
opp_enabled = 1;
// first check if we are receiving timing indications
if(nfapi_mode==4) {
if(D2D_en){
//if(nfapi_mode==4) {
usleep(10000);
if (UE->instance_cnt_timer > 0) {
external_timer = 1;
......@@ -2147,11 +2152,12 @@ static void* timer_thread( void* param ) {
UE_tport_t pdu;
pdu.header.packet_type = TTI_SYNC;
pdu.header.absSF = (timer_frame*10)+timer_subframe;
if (nfapi_mode!=3){
//Panos: substitute this check with a check related to D2D (i.e., if D2D is enabled)
//if (nfapi_mode!=3){
multicast_link_write_sock(0,
&pdu,
sizeof(UE_tport_header_t));
}
//}
}
else {
......
......@@ -120,6 +120,9 @@ int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
uint8_t nfapi_mode = 0;
// Enabling D2D operations. Currently hardcoded but it should eventually be an execution option.
uint8_t D2D_en = 0;
uint16_t sf_ahead=2;
char *emul_iface;
......@@ -588,7 +591,7 @@ static void get_options(void) {
// Read it in and store in asn1c data structures
sprintf(uecap_xer,"%stargets/PROJECTS/GENERIC-LTE-EPC/CONF/UE_config.xml",getenv("OPENAIR_HOME"));
printf("%s\n",uecap_xer);
if(nfapi_mode!=3)
if(nfapi_mode!=3 && D2D_en != 1)
uecap_xer_in=1;
} /* UE with config file */
}
......@@ -827,6 +830,8 @@ int main( int argc, char **argv )
printf("NFAPI_MODE value: %d \n", nfapi_mode);
printf("D2D_en value: %d \n \n", D2D_en);
// Panos: Not sure if the following is needed here
/*if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
if (UE_flag == 0) {
......@@ -1174,10 +1179,11 @@ int main( int argc, char **argv )
// start the main threads
int eMBMS_active = 0;
if (nfapi_mode==3) // UE-STUB-PNF
if (nfapi_mode==3 || D2D_en == 1) // UE-STUB-PNF or D2D (offnet) or both(D2D on-net)
{
config_sync_var=0;
wait_nfapi_init("main?");
if(nfapi_mode==3)
wait_nfapi_init("main?");
//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_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
......
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