Skip to main content
The Lager Rust crate gives embedded developers first-class access to Lager nets, so a hardware-in-the-loop (HIL) test suite can live next to your firmware and run with cargo test — no Python required. The crate is a pure HTTP/JSON client of the Lager Box API: power supplies, battery simulators, e-loads, solar simulators, GPIO, ADC, DAC, thermocouples, watt meters, energy analyzers, SPI, I2C, USB hub ports, robot arms, webcams, routers, and streaming UART — plus the box-level capabilities (its own BLE adapter, WiFi interface, and BluFi ESP32 provisioning). Debug-probe nets (flash / erase / reset / memory reads / RTT) talk to the box’s debug service.
The package publishes on crates.io as lager-net (the bare lager name is taken by an unrelated crate), but the library target is named lager, so your code reads use lager::LagerBox;. Full API reference lives on docs.rs/lager-net.

Quickstart

Add the crate to your firmware project’s dev-dependencies:
Write a test:
Run it:
LagerBox::connect("hostname-or-ip") also works, with an optional host:port or full URL.

Features

Both clients execute the exact same request builders and response parsers, so the two transports cannot drift apart.

Errors

Everything returns lager::Result<T> with a single Error enum:

Requirements

  • A Lager Box with software new enough to serve POST /net/command — check lager.status()?.capabilities.net_command, or run lager box update.
  • Rust 1.75+.
Oscilloscope / logic-analyzer workflows are not exposed on the box HTTP API yet, so Scope ships as a documented stub whose methods return Error::NotSupportedByBox. Support lands when the box API does; the endpoint sketch is tracked in the crate’s MISSING_ENDPOINTS.md.

Next steps