diff --git a/examples/ggwave-cli/main.cpp b/examples/ggwave-cli/main.cpp index 8ad03dc..88cff63 100644 --- a/examples/ggwave-cli/main.cpp +++ b/examples/ggwave-cli/main.cpp @@ -14,11 +14,7 @@ int main(int argc, char** argv) { printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]); printf(" -cN - select capture device N\n"); printf(" -pN - select playback device N\n"); - printf(" -tN - transmission protocol:\n"); - printf(" -t0 : Normal\n"); - printf(" -t1 : Fast (default)\n"); - printf(" -t2 : Fastest\n"); - printf(" -t3 : Ultrasonic\n"); + printf(" -tN - transmission protocol\n"); printf("\n"); auto argm = parseCmdArguments(argc, argv); @@ -33,6 +29,16 @@ int main(int argc, char** argv) { auto ggWave = GGWave_instance(); + printf("Available Tx protocols:\n"); + for (int i = 0; i < (int) ggWave->getTxProtocols().size(); ++i) { + printf(" -t%d : %s\n", i, ggWave->getTxProtocols()[i].name); + } + + if (txProtocol < 0 || txProtocol > (int) ggWave->getTxProtocols().size()) { + fprintf(stderr, "Unknown Tx protocol %d\n", txProtocol); + return -3; + } + printf("Selecting Tx protocol %d\n", txProtocol); std::mutex mutex; diff --git a/examples/ggwave-gui/main.cpp b/examples/ggwave-gui/main.cpp index 2df3cf4..3c48d49 100644 --- a/examples/ggwave-gui/main.cpp +++ b/examples/ggwave-gui/main.cpp @@ -50,17 +50,11 @@ int main(int argc, char** argv) { printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]); printf(" -cN - select capture device N\n"); printf(" -pN - select playback device N\n"); - printf(" -tN - transmission protocol:\n"); - printf(" -t0 : Normal\n"); - printf(" -t1 : Fast (default)\n"); - printf(" -t2 : Fastest\n"); - printf(" -t3 : Ultrasonic\n"); printf("\n"); auto argm = parseCmdArguments(argc, argv); int captureId = argm["c"].empty() ? 0 : std::stoi(argm["c"]); int playbackId = argm["p"].empty() ? 0 : std::stoi(argm["p"]); - int txProtocol = argm["t"].empty() ? 1 : std::stoi(argm["t"]); if (GGWave_init(playbackId, captureId) == false) { fprintf(stderr, "Failed to initialize GGWave\n");