Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ private static async Task<int> RunSdCardOperationAsync(CliOptions options)
var adcCount = streamingDevice.Metadata.Capabilities.AnalogInputChannels;
if (adcCount > 0)
{
channelMask = new string('1', adcCount);
channelMask = ((1u << adcCount) - 1).ToString();
}
}

Expand Down Expand Up @@ -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()
Expand All @@ -1322,7 +1314,7 @@ private static void PrintHelp()
Console.WriteLine("Streaming Options:");
Console.WriteLine($" --rate <hz> Streaming rate in Hz (default: {DefaultRate}).");
Console.WriteLine($" --duration <seconds> Duration to stream (default: {DefaultDurationSeconds}).");
Console.WriteLine(" --channels <mask> Enable ADC channels with a 0/1 mask.");
Console.WriteLine(" --channels <mask> Enable ADC channels with a decimal bitmask (e.g. 7 = ch 0,1,2).");
Console.WriteLine(" --limit <count> Stop after N stream messages.");
Console.WriteLine(" --min-samples <count> Require at least N stream messages (exit code 2 on failure).");
Console.WriteLine();
Expand Down