Allow >1 channel models on rfsim server

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 name.
This commit is contained in:
Bartosz Podrygajlo
2025-02-28 13:53:10 +01:00
parent 953e4a448b
commit 8672513517
2 changed files with 14 additions and 4 deletions
+9 -3
View File
@@ -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);