Depz.Sensor
1.0.0
dotnet add package Depz.Sensor --version 1.0.0
NuGet\Install-Package Depz.Sensor -Version 1.0.0
<PackageReference Include="Depz.Sensor" Version="1.0.0" />
<PackageVersion Include="Depz.Sensor" Version="1.0.0" />
<PackageReference Include="Depz.Sensor" />
paket add Depz.Sensor --version 1.0.0
#r "nuget: Depz.Sensor, 1.0.0"
#:package Depz.Sensor@1.0.0
#addin nuget:?package=Depz.Sensor&version=1.0.0
#tool nuget:?package=Depz.Sensor&version=1.0.0
Depz.Sensor (C# SDK)
A contract-first decode/encode SDK for the DEPZ sensor family. Every codec is a byte-exact port of the reference Python SDK, pinned to the golden vectors shared by all DEPZ SDKs.
Builds for .NET 8 and .NET Standard 2.1 — the latter is the shared library
Unity reads; the Windows communication module for Unity (port discovery,
serial link, DepzDevicesUnity) is the UPM package unity/
(see Installation › Unity).
Install
Published on NuGet as Depz.Sensor:
dotnet add package Depz.Sensor
Or, from a checkout of the repository, reference the project (the .NET 8 SDK builds it with yours):
dotnet add reference /path/to/packages/depz-sensor-sdk-csharp/src/Depz.Sensor/Depz.Sensor.csproj
Quick start
Program.cs of a console project (dotnet new console), run with dotnet run:
using Depz.Sensor.Devices;
try
{
using DepzDevice dev = DepzDevices.OpenDevice(); // the DEPZ board with the smallest USB serial
Console.WriteLine(dev.GetSoftwareName());
}
catch (NoDepzDeviceException e) // no board: "no DEPZ device found (…)"
{
Console.Error.WriteLine(e.Message);
Environment.Exit(1);
}
DepzDevices.ListDepzDevices() lists the boards without opening one; the
guide goes on from there.
Documentation
Full docs live under docs/:
- Common guide — what it is, install, discovery, the mental model, transport/CRC, datasets, firmware parse, testing, extension points.
- Unity package —
ai.depz.sensor: the Windows communication module and the sampleMonoBehaviour; install by git URL or by copying; limits. - API reference — every public type, generated from the
///summaries (per-sensor: SR04 · VL53L0X · VL53L1CX · VL53L1CB · VL53L3CX · VL53L4CD · VL53L4CX · VL53L5CX · VL53L7CX · VL53L7CH · VL53L8CX · VL53L8CH · TMF8829 · BNO055 · BNO085 · BNO086). - Per sensor — SR04 (intro · guide), VL53L0X (intro · guide), VL53L1CX (intro · guide), VL53L1CB (intro · guide), VL53L3CX (intro · guide), VL53L4CD (intro · guide), VL53L4CX (intro · guide), VL53L5CX (intro · guide), VL53L7CX (intro · guide), VL53L7CH (intro · guide), VL53L8CX (intro · guide), VL53L8CH (intro · guide), TMF8829 (intro · guide), BNO055 (intro · guide), BNO085 (intro · guide), BNO086 (intro · guide).
Sensors
The DEPZ line exposes these user-facing sensor types. The VL53L8 ToF is two separate silicon variants that share one wire/frame layout:
| Sensor | What it is | USB product id | SDK surface |
|---|---|---|---|
| SR04 | HC-SR04 ultrasonic ranger | 0xEC78 |
Depz.Sensor.Protocol.Sr04 |
| VL53L0X / L1CX / L1CB / L3CX / L4CX | The 1D ToF family on one I2C register-bridge firmware | 0xED41 / 0xED43 / 0xED42 / 0xED44 / 0xED46 |
Depz.Sensor.Vl53lx |
| VL53L5CX / VL53L7CX / VL53L7CH | 8×8 multizone ToF on one I2C board firmware (63° / 90° / 90° + CNH) | 0xED48 / 0xED49 / 0xED4A |
Depz.Sensor.Vl53l7 |
| VL53L8CX | Base ToF multizone ranger | dev-default (ST 0483:56DC) |
Depz.Sensor.Vl53l8 |
| VL53L8CH | CX plus CNH histograms; own PID | 0xED40 |
Depz.Sensor.Vl53l8 |
| TMF8829 | ams-OSRAM dToF, 8×8 … 48×32 zones, up to 4 peaks, SPI register bridge | 0xED4C |
Depz.Sensor.Tmf8829 |
| BNO055 | 9-axis IMU, fusion on the chip, I2C register bridge | 0xEE0A |
Depz.Sensor.Bno055 |
| BNO085 / BNO086 | 9-axis IMU / sensor-hub (SH-2 over SHTP) | 0xEE09 / 0xEE08 |
Depz.Sensor.Bno086 |
VL53L8CX vs VL53L8CH
VL53L8CX is the base ToF and the development default (it enumerates under
the raw ST VID/PID until reprogrammed). VL53L8CH is a superset: same
ranging engine plus CNH (compact new histograms), and it ships with its own
production USB PID (0xED40, hinted vl53l8ch).
Because both variants stream the same ULD results-frame layout, a single decode path serves both:
Vl53l8FrameDecoder— results-frame decode (distance/status/signal/…), shared by CX and CH. The only variant-visible difference is the frame-id footer offset (CX FW / ULD 2.1.0 = 12 bytes from end; CH FW / VL53LMZ 2.0.16 = 4). Select withVl53l8FrameDecoder.ForVariant(Vl53l8Variant.Cx | .Ch).Vl53l8Advanced/MotionConfig— advanced DCI codecs (motion-indicator config, detection thresholds, xtalk margin). Shared by CX and CH.
Coverage today
Live device layer (contract 07) — connection and reader thread, requests,
streams (callbacks and drop-oldest queues), events, time sync, .depzrec
record/replay and port discovery — with the SR04, VL53L4CD (the ST
ULD 2.2.3 on the host), the VL53L 1D family (VL53L0X / L1CX / L1CB / L3CX / L4CX:
the PAL, the ULDs, the ULP and the histogram BareDriver on the host), VL53L8CX / VL53L8CH and VL53L5CX / VL53L7CX / VL53L7CH (the ST ULD with the
sensor firmware download, CNH) BNO055, BNO085 / BNO086 and TMF8829 (the sensor sequence with the firmware download) classes — every sensor of the line; the shared device scenarios (contract 15)
run against them. In Unity on Windows the same classes open through the
communication module unity/ (DepzDevicesUnity, WindowsSerialLink).
Verifiable, golden-vector-backed codecs are implemented for every sensor:
- SR04 — command encode + data/period/decay decode.
- VL53L0X / L1CX / L1CB / L3CX / L4CX — v2.00 codecs, the product table and class resolution, die-block / VL53L0X raw / histogram-block decode; the live drivers (VL53L0X PAL, VL53L1X / L4CD ULDs, L3CX ULP, the histogram BareDriver with up to four targets per frame).
- VL53L4CD — register-bridge codecs, result decode, timing/tuning math and init block; the live ULD driver (init, ranging, calibration).
- VL53L5CX / VL53L7CX / VL53L7CH — pin control / bus speed / info codecs, class resolution, and the L5/L7 frame decoder (footer at size − 4, per-zone trim), replayed against live-board captures.
- VL53L8CX / VL53L8CH — framing → chunk reassembly → results-frame decode
(shared), plus the advanced DCI codecs (shared). Exercised end-to-end by a
recorded
.depzrecreplay. - VL53L7CH / VL53L8CH CNH —
Vl53l8Cnh.DecodeHistogramunpacks the raw CNH block into per-aggregate histograms. - TMF8829 — wire codecs, chunk reassembly, frame / pixel decode and the half-frame merge, clock model and capture time, config-page fields, the embedded ams sensor firmware (MIT); the live sensor sequence.
- BNO055 — wire codecs, units / calibration status and profile / axis remap
- placements / page-1 configs, register-window decode.
- BNO085 / BNO086 — SHTP framing/reassembly, SH-2 control encode and response decode (features, product id, commands, FRS sessions, metadata), input-report and gyro-integrated-RV decode; the live SH-2 hub session.
Plus the shared foundation: CRC KATs, DEPZ framing encode/decode, USB identity
table + discovery ordering, common commands (time-sync, sync-pin), .fwdepz
image parse, and .depzdata datasets: the multi-device recorder, the reader and
the timeline player.
Tests
The SDK is tested without hardware against golden vectors and recorded sessions of real boards shared by all seven SDKs. The test suite is kept in DEPZ's development repository and is not part of this one.
On real boards: dotnet run --project examples/LiveCheck -- [seconds] [port ...] opens every DEPZ board on the machine, streams 10 s and
prints its rate and a plausibility value — the centre distance of a ToF sensor,
|gravity| of a BNO055 (no DEPZ board found (…), exit code 1, on a machine with none). The Python, Rust, Java and C# SDKs carry the same check;
on 2026-10-26 all four agreed on ten boards.
Compatibility after 1.0
From 1.0 a minor release only adds (contract 07 §5): a component on a record
the SDK produces (DeviceInfo, TimeSync, the DeviceEvent records, every
measurement / frame / sample / report, Identity, Tmf8829AppliedConfig, the
SH-2 replies, the wire reports under Protocol, DatasetRecord), a component
on a record you build, a member of an open set (SensorType, Status,
PlayerState, the DeviceEvent and ParserEvent subclasses, the BNO086
BnoReport subclasses). A new component is always a trailing optional
parameter with a default — never inserted in the middle — so three rules keep
your code building across those additions:
- Build a record with named arguments (
new SyncPinConfig(Pin: 1, Mode: SyncPinMode.In, Polarity: SyncPinPolarity.IdleLow)) or from an existing value withwith { }(Bno055AccelConfig.Default with { Range = 2 }). A positional list of every component still compiles after an addition — the new component takes its default — but names say what each value is. The records you build:SyncPinConfig,CalibrationConfig,Vl53l8Advanced.DetectionThreshold,Vl53l8CnhConfig,Bno055Units,Bno055AxisRemap,Bno055CalibrationProfile,Bno055AccelConfig/GyroConfig/MagConfig,ShtpHeader,UsbIds.PortCandidate. - Read a produced record through its properties. Do not deconstruct it
positionally:
var (port, mode, …) = infonames every component and stops compiling when one is appended. - A
switchon an SDK enum or onDeviceEvent/BnoReportkeeps adefault(statement) or_ =>(expression) arm: a new member or subclass is a minor release.
dev.SetSyncPin(new SyncPinConfig(Pin: 3, Mode: SyncPinMode.OutBoth, Polarity: SyncPinPolarity.IdleHigh)); // right
var (pin, mode, polarity) = cfg; // wrong: positional deconstruction
License
MIT. The bundled VL53L5 / VL53L7 / VL53L8 sensor firmware, configuration
data and the driver code ported from ST's Ultra Lite Driver are
© STMicroelectronics (BSD-3-Clause,
licenses/vl53l8/LICENSE-BSD-3-Clause.txt); the bundled TMF8829 sensor firmware is
© ams-OSRAM (MIT, licenses/tmf8829/ of the NuGet package).
Open source — source and issue tracker: https://github.com/depz-ai/depz-sensor-sdk.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- System.IO.Ports (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 87 | 11/18/2026 |
| 0.10.0 | 93 | 11/9/2026 |
| 0.9.1 | 120 | 10/30/2026 |
| 0.9.0 | 99 | 10/29/2026 |
| 0.8.0 | 105 | 10/27/2026 |
| 0.7.0 | 104 | 10/23/2026 |
| 0.6.0 | 108 | 10/21/2026 |
| 0.5.0 | 122 | 10/19/2026 |
| 0.4.2 | 104 | 10/14/2026 |
| 0.4.0 | 99 | 10/2/2026 |
| 0.3.0 | 105 | 9/30/2026 |
| 0.2.1 | 134 | 9/6/2026 |
| 0.2.0 | 135 | 9/6/2026 |
| 0.1.4 | 119 | 9/1/2026 |
| 0.1.3 | 132 | 8/20/2026 |
| 0.1.2 | 140 | 7/6/2026 |
| 0.1.1 | 136 | 7/6/2026 |
| 0.1.0 | 140 | 7/6/2026 |