diff --git a/Program.cs b/Program.cs index cd55f2c..9f951a3 100644 --- a/Program.cs +++ b/Program.cs @@ -725,7 +725,7 @@ private static async Task RunSdCardOperationAsync(CliOptions options) var adcCount = streamingDevice.Metadata.Capabilities.AnalogInputChannels; if (adcCount > 0) { - channelMask = new string('1', adcCount); + channelMask = ((1u << adcCount) - 1).ToString(); } } @@ -1289,15 +1289,7 @@ private static string GetLogFormatLabel(string fileName) private static bool IsValidChannelMask(string channelMask) { - foreach (var value in channelMask) - { - if (value != '0' && value != '1') - { - return false; - } - } - - return true; + return uint.TryParse(channelMask, out _); } private static void PrintHelp() @@ -1322,7 +1314,7 @@ private static void PrintHelp() Console.WriteLine("Streaming Options:"); Console.WriteLine($" --rate Streaming rate in Hz (default: {DefaultRate})."); Console.WriteLine($" --duration Duration to stream (default: {DefaultDurationSeconds})."); - Console.WriteLine(" --channels Enable ADC channels with a 0/1 mask."); + Console.WriteLine(" --channels Enable ADC channels with a decimal bitmask (e.g. 7 = ch 0,1,2)."); Console.WriteLine(" --limit Stop after N stream messages."); Console.WriteLine(" --min-samples Require at least N stream messages (exit code 2 on failure)."); Console.WriteLine();