added option in RF UHD for silent stdout

This commit is contained in:
Ismael Gomez 2017-02-21 12:34:49 +01:00
parent 4a1ce64c55
commit 7aa1e5f5c4
1 changed files with 6 additions and 1 deletions

View File

@ -267,6 +267,7 @@ int rf_uhd_open(char *args, void **h)
} }
handler->devname = NULL; handler->devname = NULL;
/* If device type or name not given in args, choose a B200 */ /* If device type or name not given in args, choose a B200 */
if (args[0]=='\0') { if (args[0]=='\0') {
if (find_string(devices_str, "type=b200") && !strstr(args, "recv_frame_size")) { if (find_string(devices_str, "type=b200") && !strstr(args, "recv_frame_size")) {
@ -294,7 +295,11 @@ int rf_uhd_open(char *args, void **h)
uhd_string_vector_free(&devices_str); uhd_string_vector_free(&devices_str);
/* Create UHD handler */ /* Create UHD handler */
printf("Opening USRP with args: %s\n", args); if (strstr(args, "silent")) {
rf_uhd_suppress_stdout(NULL);
} else {
printf("Opening USRP with args: %s\n", args);
}
uhd_error error = uhd_usrp_make(&handler->usrp, args); uhd_error error = uhd_usrp_make(&handler->usrp, args);
if (error) { if (error) {
fprintf(stderr, "Error opening UHD: code %d\n", error); fprintf(stderr, "Error opening UHD: code %d\n", error);