diff --git a/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md b/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md index 30cc68e662..e3e3bd3189 100644 --- a/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md +++ b/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md @@ -90,7 +90,11 @@ channelmod = { }; ``` -where `rfsimu_channel_ue0` will be activated on server side (i.e. eNB/gNB) for uplink and `rfsimu_channel_enB0` will be activated on client side (i.e. UE) for downlink. +where `rfsimu_channel_ue0` will be activated on server side for uplink and `rfsimu_channel_enB0` will be activated on client side for downlink. + +Use `rfsimu_channel_ue1`, `rfsimu_channel_ue2`, etc. if you want to use different channel models for each client. The client connection order determines its channel model. + +The server could be either the UE or the gNB, the channel name suffix does not depend on the application but on the rfsimulators role (server/client). ## Edit the configuration file diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index 8cf4324dd7..b11f4034ca 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -260,11 +260,17 @@ static int allocCirBuf(rfsimulator_state_t *bridge, int sock) tableNor(rand); init_done=true; } - char *modelname = (bridge->role == SIMU_ROLE_SERVER) ? "rfsimu_channel_ue0" : "rfsimu_channel_enB0"; + char modelname[30]; + snprintf(modelname, sizeofArray(modelname), "rfsimu_channel_%s%d", (bridge->role == SIMU_ROLE_SERVER) ? "ue" : "enB", nb_ue); ptr->channel_model = find_channel_desc_fromname(modelname); // path_loss in dB if (!ptr->channel_model) { - LOG_E(HW, "Channel model %s not found, check config file\n", modelname); - return -1; + // Use legacy method to find channel model - this will use the same channel model for all clients + char *legacy_model_name = (bridge->role == SIMU_ROLE_SERVER) ? "rfsimu_channel_ue0" : "rfsimu_channel_enB0"; + ptr->channel_model = find_channel_desc_fromname(legacy_model_name); + if (!ptr->channel_model) { + LOG_E(HW, "Channel model %s/%s not found, check config file\n", modelname, legacy_model_name); + return -1; + } } set_channeldesc_owner(ptr->channel_model, RFSIMU_MODULEID);