ONEPROOF.LinkHid
0.0.9
dotnet add package ONEPROOF.LinkHid --version 0.0.9
NuGet\Install-Package ONEPROOF.LinkHid -Version 0.0.9
<PackageReference Include="ONEPROOF.LinkHid" Version="0.0.9" />
<PackageVersion Include="ONEPROOF.LinkHid" Version="0.0.9" />
<PackageReference Include="ONEPROOF.LinkHid" />
paket add ONEPROOF.LinkHid --version 0.0.9
#r "nuget: ONEPROOF.LinkHid, 0.0.9"
#:package ONEPROOF.LinkHid@0.0.9
#addin nuget:?package=ONEPROOF.LinkHid&version=0.0.9
#tool nuget:?package=ONEPROOF.LinkHid&version=0.0.9
ONEPROOF.LinkHid
Pure .NET library for communicating with the ONEPROOF LINK over USB HID. Zero native dependencies.
Features
- Barcode scanning - QR codes and PDF417 barcodes via HID events
- Device commands - Device ID, reboot, NFC status, peripheral reset, and more
- PC/SC reader listing - Enumerate smart card readers
- Zero native DLLs - Uses raw Windows HID API via P/Invoke. No external dependencies.
Requirements
- .NET 9 (Windows)
- ONEPROOF LINK
Installation
dotnet add package ONEPROOF.LinkHid
Quick Start
using LinkHid;
using LinkHid.Models;
using var device = new LinkDevice();
device.BarcodeScanned += (sender, e) =>
{
Console.WriteLine($"{e.Type}: {e.Data}");
};
device.Connect();
string id = device.Settings!.GetDeviceId(); // "ONEPROOF:LINK"
string[] readers = LinkDevice.ListReaders();
WPF Usage
Events fire on a background thread. Marshal to the UI thread:
device.BarcodeScanned += (s, e) =>
{
Dispatcher.Invoke(() => BarcodeText.Text = e.Data);
};
API Reference
LinkDevice
| Member | Description |
|---|---|
Connect() |
Auto-detect and connect to LINK |
Connect(string path) |
Connect to a specific device path |
Disconnect() |
Disconnect and release resources |
IsConnected |
Whether the device is connected |
BarcodeScanned |
Event fired when a barcode is scanned |
DeviceConnected |
Event fired on successful connection |
DeviceDisconnected |
Event fired on disconnect or unplug |
Settings |
Access device commands (see below) |
ListReaders() |
Static: list PC/SC smart card readers |
LinkDeviceSettings (via device.Settings)
| Method | Description |
|---|---|
GetDeviceId() |
Returns device ID string |
Reboot() |
Reboots the LINK |
I2CScan() |
Returns I2C bus scan results |
NfcStatus() |
Returns NFC peripheral status |
NfcReinit() |
Reinitializes NFC peripheral |
ResetPeripherals() |
Resets NFC and barcode scanner to idle (see below) |
IMPORTANT: ResetPeripherals()
What it does
ResetPeripherals() resets the NFC reader and barcode scanner on the LINK back to their idle/discovery state without disconnecting USB. Think of it as "clear the board and start fresh."
Why it exists
The LINK has multiple peripherals (NFC reader, barcode scanner) that maintain internal state during a transaction:
- The NFC reader enters passthrough mode when a phone taps for mDL verification. After BLE takes over, it stays in passthrough mode and won't detect new cards until reset.
- The barcode scanner can get stuck in a partial-read state after errors or timeouts.
- After BLE verification completes, the phone may still be physically on the reader. Without resetting, the LINK will re-detect the phone and fire a stale notification, causing errors.
Without calling ResetPeripherals(), the LINK will stop responding to new scans or NFC taps after the first transaction.
When to call it
1. After BLE verification completes (REQUIRED)
After your app finishes a BLE mDL verification flow, the NFC reader is still in passthrough mode. You must reset before the LINK can accept new input.
device.BarcodeScanned += async (s, e) =>
{
// QR code scanned, start BLE verification
var result = await RunBleVerification(e.Data);
// BLE verification done, MUST reset peripherals.
// NFC reader is still in passthrough mode from the handover.
// Without this, the LINK won't detect new cards or barcodes.
device.Settings!.ResetPeripherals();
UpdateUI("Ready for next verification");
};
2. After any error or timeout during a transaction (REQUIRED)
If something goes wrong mid-transaction, the LINK may be stuck in a partial state. Reset clears it.
device.BarcodeScanned += async (s, e) =>
{
try
{
var result = await RunBleVerification(e.Data);
DisplayResult(result);
}
catch (Exception ex)
{
LogError(ex);
}
finally
{
// ALWAYS reset after a transaction, success or failure.
device.Settings!.ResetPeripherals();
}
};
3. Before each new verification cycle in a continuous loop (RECOMMENDED)
If your app runs in kiosk/loop mode, call reset at the top of each cycle to guarantee a clean state.
while (running)
{
// Reset to clean state before waiting for input
device.Settings!.ResetPeripherals();
await WaitForNextVerification();
}
When you do NOT need to call it
| Scenario | Why |
|---|---|
| Between consecutive barcode-only scans (no BLE/NFC) | Scanner auto-resets after each scan |
Right after Connect() |
LINK starts in a clean idle state |
Right after Reboot() |
Reboot already resets everything |
Right after NfcReinit() |
NFC is already reinitialized |
Summary
Connect() > Scan barcode > BLE verification > ResetPeripherals() > Ready for next
|
|-- Success > ResetPeripherals()
|-- Error > ResetPeripherals()
Rule of thumb: if you did anything with BLE or NFC, call ResetPeripherals() before accepting new input.
License
Proprietary. Copyright (c) 2026 ONEPROOF Inc. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. |
-
net9.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.