diff --git a/host/utilities/bladeRF-cli/src/cmd/printset.c b/host/utilities/bladeRF-cli/src/cmd/printset.c index 70138d2b..720e67ec 100644 --- a/host/utilities/bladeRF-cli/src/cmd/printset.c +++ b/host/utilities/bladeRF-cli/src/cmd/printset.c @@ -91,6 +91,7 @@ PRINTSET_DECL(refin_freq); PRINTSET_DECL(rssi); PRINTSET_DECL(rx_mux); PRINTSET_DECL(tuning_mode); +PRINTSET_DECL(bitmode); PRINTSET_DECL(rxvga1); PRINTSET_DECL(rxvga2); PRINTSET_DECL(samplerate); @@ -110,6 +111,7 @@ struct printset_entry printset_table[] = { PRINTSET_ENTRY(bandwidth, PRINTALL_OPTION_APPEND_NEWLINE, BOARD_ANY), PRINTSET_ENTRY(frequency, PRINTALL_OPTION_APPEND_NEWLINE, BOARD_ANY), PRINTSET_ENTRY(tuning_mode, PRINTALL_OPTION_APPEND_NEWLINE, BOARD_ANY), + PRINTSET_ENTRY(bitmode, PRINTALL_OPTION_APPEND_NEWLINE, BOARD_ANY), PRINTSET_ENTRY(agc, PRINTALL_OPTION_APPEND_NEWLINE, BOARD_ANY), PRINTSET_ENTRY(clock_ref, PRINTALL_OPTION_NONE, BOARD_BLADERF2), PRINTSET_ENTRY(refin_freq, PRINTALL_OPTION_NONE, BOARD_BLADERF2), diff --git a/host/utilities/bladeRF-cli/src/cmd/printset.h b/host/utilities/bladeRF-cli/src/cmd/printset.h index a73d529e..f22904ef 100644 --- a/host/utilities/bladeRF-cli/src/cmd/printset.h +++ b/host/utilities/bladeRF-cli/src/cmd/printset.h @@ -104,6 +104,8 @@ int print_rx_mux(struct cli_state *state, int argc, char **argv); int set_rx_mux(struct cli_state *state, int argc, char **argv); int print_tuning_mode(struct cli_state *state, int argc, char **argv); int set_tuning_mode(struct cli_state *state, int argc, char **argv); +int print_bitmode(struct cli_state *state, int argc, char **argv); +int set_bitmode(struct cli_state *state, int argc, char **argv); int print_rxvga1(struct cli_state *state, int argc, char **argv); int set_rxvga1(struct cli_state *state, int argc, char **argv); int print_rxvga2(struct cli_state *state, int argc, char **argv); diff --git a/host/utilities/bladeRF-cli/src/cmd/printset_impl.c b/host/utilities/bladeRF-cli/src/cmd/printset_impl.c index dc1951da..5c76b163 100644 --- a/host/utilities/bladeRF-cli/src/cmd/printset_impl.c +++ b/host/utilities/bladeRF-cli/src/cmd/printset_impl.c @@ -1221,6 +1221,45 @@ out: return rv; } +/* bitmode */ +int print_bitmode(struct cli_state *state, int argc, char **argv) +{ + int rv = CLI_RET_OK; + printf(" Bit Mode: %s bit samples\n", state->bit_mode_8bit ? "8" : "16"); + return rv; +} + +int set_bitmode(struct cli_state *state, int argc, char **argv) +{ + int rv = CLI_RET_OK; + + if (cli_device_is_streaming(state)) { + printf(" Warning: Changing bit mode will not take affect while device" + " is streaming.\n\n"); + } + + if (argc != 3) { + if (argc == 2) { + printf("Usage: %s %s <8|16>\n", argv[0], argv[1]); + return 0; + } else { + return CLI_RET_NARGS; + } + } + + if (!strcasecmp("16", argv[2]) || !strcasecmp("16bit", argv[2])) { + state->bit_mode_8bit = false; + } else if (!strcasecmp("8", argv[2]) || !strcasecmp("8bit", argv[2])) { + state->bit_mode_8bit = true; + } else { + return CLI_RET_INVPARAM; + } + + rv = print_bitmode(state, 0, NULL); + + return rv; +} + /* rxvga1 */ int print_rxvga1(struct cli_state *state, int argc, char **argv) {