rf_uhd: device familiy detection when device_args are supplied

This commit is contained in:
Ismael Gomez 2016-10-05 21:36:51 +02:00
parent 1f6e63ae4f
commit cbade7d29c
2 changed files with 17 additions and 4 deletions

View File

@ -258,7 +258,7 @@ int rf_uhd_open(char *args, void **h)
if (args == NULL) {
args = "";
}
handler->devname = "uhd_unknown";
handler->devname = NULL;
/* If device type or name not given in args, choose a B200 */
if (args[0]=='\0') {
@ -291,7 +291,19 @@ int rf_uhd_open(char *args, void **h)
fprintf(stderr, "Error opening UHD: code %d\n", error);
return -1;
}
if (!handler->devname) {
char dev_str[1024];
uhd_usrp_get_mboard_name(handler->usrp, 0, dev_str, 1024);
if (strstr(dev_str, "B2") || strstr(dev_str, "B2")) {
handler->devname = DEVNAME_B200;
} else if (strstr(dev_str, "X3") || strstr(dev_str, "X3")) {
handler->devname = DEVNAME_X300;
}
}
if (!handler->devname) {
handler->devname = "uhd_unknown";
}
size_t channel = 0;
uhd_stream_args_t stream_args = {
.cpu_format = "fc32",

View File

@ -302,12 +302,13 @@ int srslte_ue_dl_decode_rnti(srslte_ue_dl_t *q, cf_t *input, uint8_t *data, uint
fprintf(stderr, "Error calling srslte_pdsch_decode()\n");
}
}
/*
printf("Saving signal...\n");
srslte_vec_save_file("input", input, sizeof(cf_t)*SRSLTE_SF_LEN_PRB(q->cell.nof_prb));
srslte_ue_dl_save_signal(q, &q->softbuffer, sf_idx, rvidx, rnti, cfi);
//exit(-1);
*/
}