This is a lightweight CLI that demonstrates how to use Daqifi.Core to discover devices, connect, configure channels, stream data, and stop streaming. It is intended both as a reference for third-party developers and as a validation tool for hardware-in-the-loop testing.
- .NET 8 SDK
- A DAQiFi device on the same network
Discover devices:
dotnet run -- --discoverConnect and stream:
dotnet run -- \
--ip 192.168.1.44 \
--port 9760 \
--rate 10 \
--channels 0000000011 \
--duration 10--discoverdiscover devices over UDP--ip <address>device IP address--port <number>TCP port (default 9760)--rate <hz>sampling rate in Hz (default 100)--duration <seconds>streaming duration (default 10)--channels <mask>ADC channel enable mask (0/1 string)--limit <count>stop after N stream messages--min-samples <count>require at least N stream messages (exit code 2 on failure)--format <text|csv|jsonl>output format for samples--output <path>write samples to file instead of stdout--connect-timeout <seconds>TCP connect timeout (default 5)--connect-attempts <n>total connect attempts (default 1)--keep-connectedkeep connection open after streaming stops--show-statusprint protobuf status messages--discover-timeout <seconds>discovery timeout (default 5)
text(default): human-readable line per samplecsv:timestamp,analog_values,digital_hexjsonl: one JSON object per line
0success1error during connect/stream2validation failed (--min-samplesnot met)
This app is designed to validate daqifi-core changes against real hardware. AI agents can run this CLI as a hardware-in-the-loop check after modifying daqifi-core.
By default the app references the published NuGet package. To validate local changes, point the build to a local Daqifi.Core.csproj using the MSBuild property below.
dotnet run -p:DaqifiCoreProjectPath=/path/to/daqifi-core/src/Daqifi.Core/Daqifi.Core.csproj -- \
--ip 192.168.1.44 \
--port 9760 \
--rate 10 \
--channels 0000000011 \
--duration 10 \
--min-samples 5dotnet run -p:DaqifiCoreProjectPath=/path/to/daqifi-core/src/Daqifi.Core/Daqifi.Core.csproj -- \
--ip 192.168.1.44 \
--port 9760 \
--rate 10 \
--channels 0000000011 \
--duration 10 \
--min-samples 5 \
--format jsonl \
--output /tmp/daqifi-samples.jsonlThe command exits non-zero if it fails to connect/stream or if --min-samples is not met.
- If connect times out, confirm the device IP/port and that LAN is enabled.
- If no samples appear, verify channel mask and sampling rate.