RgbDriverKit 3.0.97-g6a32125d32
dotnet add package RgbDriverKit --version 3.0.97-g6a32125d32
NuGet\Install-Package RgbDriverKit -Version 3.0.97-g6a32125d32
<PackageReference Include="RgbDriverKit" Version="3.0.97-g6a32125d32" />
<PackageVersion Include="RgbDriverKit" Version="3.0.97-g6a32125d32" />
<PackageReference Include="RgbDriverKit" />
paket add RgbDriverKit --version 3.0.97-g6a32125d32
#r "nuget: RgbDriverKit, 3.0.97-g6a32125d32"
#:package RgbDriverKit@3.0.97-g6a32125d32
#addin nuget:?package=RgbDriverKit&version=3.0.97-g6a32125d32&prerelease
#tool nuget:?package=RgbDriverKit&version=3.0.97-g6a32125d32&prerelease
RgbDriverKit
Professional .NET SDK for Broadcom optical spectrometers, providing comprehensive support for Qseries, Qmini, Qneo, and Qstick spectrometer devices.
Overview
RgbDriverKit is a cross-platform .NET Standard 2.0 library designed for scientific and industrial spectroscopy applications. It provides high-level APIs for controlling Broadcom's advanced spectrometer product lines, enabling precise spectrum acquisition, real-time analysis, and comprehensive device management.
Why RgbDriverKit
- NuGet-first distribution: Signed, SourceLink-enabled packages with RID-specific native assets ship through nuget.org, so your build agents and production images consume the same artifacts.
- Device safety baked in: Capability flags, validation helpers, and simulator-backed tests prevent unsafe exposure times or laser misuse before the code hits hardware.
- Production observability: Optional
ILogger, diagnostics hooks, and telemetry breadcrumbs make it easy to integrate with modern monitoring stacks. - Sample-backed documentation: All quick-start snippets map to runnable projects under
samples/, ensuring the docs and SDK never drift apart.
Architecture at a Glance
- Abstractions (
Spectrometer,LightSource,LaserDriver): Hardware-agnostic contracts with calibration logic. - Transports & interfaces (
LibUsbInterface,WinUsbInterface,SerialPortInterface,FtdiInterface): Contain native interop, retry policies, and device discovery. - Device families (
QseriesDriver,QstickDriver,QwaveDriver): Bundle command sets, capability detection, and metadata. - Simulators & diagnostics (
SimulatedSpectrometer, stress helpers): Allow unit tests and CI to mimic real devices without USB access.
See docs/BestPractices.md for deeper architectural and packaging guidance.
Supported Devices
Qmini Series - Miniature USB Spectrometers
- AFBR-S20M2UV: UV measurements (220-400 nm)
- AFBR-S20M2DUV: Deep UV measurements (185-375 nm)
- AFBR-S20M2VI: Visible measurements (370-750 nm)
- AFBR-S20M2VN: VIS/NIR measurements (480-1100 nm)
- AFBR-S20M2NI: NIR measurements (730-1080 nm)
- AFBR-S20M2WU: Wide UV measurements (225-1000 nm)
- AFBR-S20M2WV: Wide VIS measurements (225-1000 nm)
Qneo Series - Industrial Spectrometers
- AFBR-S20N1N256: NIR industrial USB spectrometer (950-1700 nm)
Qseries - Advanced Laboratory Spectrometers
Full-featured spectrometers with advanced processing capabilities
Qstick - Compact Measurement Solutions
Portable spectrometer solutions for field applications
Key Features
- Cross-Platform Support: Windows, Linux, macOS (x64/ARM64)
- Advanced Spectrum Processing: Dark subtraction, non-linearity correction, calibration
- Real-Time Acquisition: High-speed spectrum capture with configurable parameters
- Multiple Communication Interfaces: USB, Serial, FTDI, USBTMC support
- Temperature Control: Device temperature monitoring and management
- Comprehensive Calibration: Wavelength, sensitivity, and PRNU calibration
- Thread-Safe Operations: Concurrent device access and background processing
Installation
Install via NuGet Package Manager:
dotnet add package RgbDriverKit
Or using Package Manager Console in Visual Studio:
Install-Package RgbDriverKit
The package currently targets netstandard2.0, making it compatible with .NET Framework 4.8, .NET 6/7/8, and Unity/Mono environments. When running on trimming-friendly runtimes, enable dynamic code roots for the native interop layer or multi-target the SDK (see docs/BestPractices.md#7-nuget-packaging-versioning).
Package Quality & NuGet Best Practices
- Deterministic builds + SourceLink: Enable
ContinuousIntegrationBuild, SourceLink, and embedded sources so debugging into the package matches the tagged commit. - Signed & validated artifacts: Sign managed assemblies/native DLLs, then run
dotnet nuget verify --all(or thepacktask) as part of CI before publishing. - Runtime-specific assets: Keep libusb binaries under
runtimes/<RID>/native/so NuGet selects the correct dependency without manual copying. - Symbols & documentation: Publish
.snupkgfiles and XML documentation to nuget.org to help integrators diagnose device issues quickly. - SBOM + vulnerability scanning: Export a CycloneDX SBOM from
dotnet buildordotnet packand scan it before release to satisfy supply-chain policies.
Production Integration Checklist
- Verify device discovery: Use
samples/RgbDriverKit.Exampleor your own CLI to confirm USB descriptors, firmware versions, and calibration metadata before deploying to the line. - Guard long-running tasks: Wrap acquisition loops in cancellation-aware tasks and monitor
AvailableSpectracounters to avoid blocking UI threads. - Persist calibration state: Call
LoadUserCalibration()on startup, log any fallbacks to factory calibration, and store the calibration checksum next to captured spectra. - Instrument the pipeline: Forward SDK logs to
ILogger/EventSource or OpenTelemetry exporters for traceability across fleets. - Automate regression coverage: Run
dotnet test tests/RgbDriverKit.Tests(simulators) plus integration suites gated by hardware availability to catch transport regressions early.
CI/CD & Evidence Automation
PowerShell helpers under scripts/ produce attachable evidence bundles for NuGet releases in Artifactory or nuget.org:
./scripts/New-TestReport.ps1runs the simulator-backed test suite, writes.trx+ JSON summaries underartifacts/reports/tests, and zips them with a SHA-256 manifest intoartifacts/evidence../scripts/New-CoverageReport.ps1reruns the suite with Coverlet instrumentation, emitting Cobertura/JSON coverage, a normalized summary, and a zipped manifest inartifacts/evidence../scripts/New-TestHistoryReport.ps1and./scripts/New-TestHtmlReport.ps1generate auditor-friendly timelines for continuous compliance.
Each script accepts overrides for -Project, -Configuration, -ArtifactsRoot, and -SkipBuild, making it easy to reuse the same automation locally or in CI.
Run these scripts in CI after dotnet pack succeeds, then attach the manifest bundle to your release notes and NuGet publication record.
Security Scanning
Keep supply-chain evidence current by running the provided automation helpers before promoting a release candidate:
scripts/run-blackduck-scan.ps1resolves the Nerdbank.GitVersioning version, restores tools, and runs a Detect 11 policy check against theIFPD-AFBR-S20-APIproject in Black Duck. Use-DryRunfor local validation without contacting the service.scripts/run-coverity-scan.ps1captures acov-buildofRgbDriverKit.sln, analyzes it locally with the Windows Coverity installation, and uploads defects to Coverity Connect using the repo-scoped.cov\auth-key.txt.
Typical Coverity invocation:
pwsh ./scripts/run-coverity-scan.ps1 `
-CoverityBinPath "C:\Program Files\Coverity\Coverity Static Analysis\bin" `
-AuthKeyPath ".cov\auth-key.txt"
The script derives the stream name (IFPD-AFBR-S20-API-<version>) from NBGV metadata, stores captures under artifacts/coverity/cov-int, and honors -DryRun to skip uploads when testing locally.
Quick Start
using RgbDriverKit;
// Discover connected spectrometers
var devices = Qseries.SearchDevices();
if (devices.Length == 0)
{
Console.WriteLine("No spectrometers found");
return;
}
// Connect to the first device
var spectrometer = devices[0];
spectrometer.Open();
try
{
// Configure acquisition parameters
spectrometer.ExposureTime = 0.1f; // 100ms
spectrometer.Averaging = 5; // Average 5 spectra
// Configure processing steps
if (spectrometer is CalibratedSpectrometer calibrated)
{
calibrated.ProcessingSteps = SpectrometerProcessing.AdjustOffset |
SpectrometerProcessing.SubtractDark |
SpectrometerProcessing.SensitivityCalibration;
}
// Acquire spectrum
float[] spectrum = spectrometer.GetSpectrum();
float[] wavelengths = spectrometer.GetWavelengths();
Console.WriteLine($"Acquired spectrum with {spectrum.Length} data points");
Console.WriteLine($"Wavelength range: {wavelengths[0]:F1} - {wavelengths[wavelengths.Length-1]:F1} nm");
Console.WriteLine($"Load level: {spectrometer.LoadLevel:F3}");
}
finally
{
spectrometer.Close();
}
Advanced Usage
Multiple Device Types
// Search for specific device types
var qminiDevices = RgbSpectrometer.SearchDevices(); // Qmini/Qwave
var qstickDevices = Qstick.SearchDevices(); // Qstick
var laserDevices = RgbLaser.SearchDevices(); // Laser modules
Asynchronous Spectrum Acquisition
// Start exposure and wait for completion
spectrometer.StartExposure();
while (spectrometer.Status != SpectrometerStatus.Idle &&
spectrometer.AvailableSpectra == 0)
{
await Task.Delay(10);
}
if (spectrometer.AvailableSpectra > 0)
{
float[] spectrum = spectrometer.GetSpectrum();
// Process spectrum data
}
Temperature Monitoring
if (spectrometer.CanReadTemperature)
{
float temperature = spectrometer.Temperature;
Console.WriteLine($"Device temperature: {temperature:F1}°C");
}
Native Libraries
This package includes native libusb libraries for cross-platform USB communication:
- Windows x64:
runtimes/win-x64/native/libusb-1.0.dll - Windows x86:
runtimes/win-x86/native/libusb-1.0.dll - Linux x64:
runtimes/linux-x64/native/libusb-1.0.so - macOS x64:
runtimes/osx-x64/native/libusb-1.0.dylib - macOS ARM64:
runtimes/osx-arm64/native/libusb-1.0.dylib
libusb Licensing
The included libusb libraries are licensed under LGPL v2.1+. Source code and complete licensing information is available at libusb.info. See NOTICES.md for complete licensing details.
System Requirements
- .NET Standard 2.0 compatible runtime
- Windows: Windows 10 or later, WinUSB driver
- Linux: libusb-1.0 development packages
- macOS: macOS 10.14 or later
- USB: Compatible with USB 2.0 and 3.0 ports
Building from Source
Clone the repository:
git clone https://github.com/broadcom/RgbDriverKit.git cd RgbDriverKitBuild the solution:
dotnet buildRun the example:
dotnet run --project samples/RgbDriverKit.Example
Documentation
- API Reference: Generated from XML documentation comments
- Getting Started: See
samples/RgbDriverKit.Example/for comprehensive examples - Best Practices: See
docs/BestPractices.mdfor SDK architecture, packaging, and testing guidance - SDK Documentation: See
docs/SDKDocumentation.mdfor namespace overviews, lifecycle guidance, and XML doc generation steps - Device Manuals: Available from Broadcom's optical sensors documentation
Support and Licensing
RgbDriverKit is proprietary software distributed under the Broadcom SDK Agreement. See LICENSE file for complete terms and conditions.
For technical support and licensing inquiries, please contact Broadcom customer support.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- System.IO.Ports (>= 8.0.0)
-
net6.0
- System.IO.Ports (>= 8.0.0)
-
net8.0
- System.IO.Ports (>= 10.0.0)
-
net9.0
- System.IO.Ports (>= 10.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 |
|---|
See CHANGELOG.md for release notes