Z-bit

OSDP for .NET, a few lines away

A mature, Apache-licensed .NET implementation of the Open Supervised Device Protocol, in production for years. Install the NuGet package, open a connection, and start talking to readers.

Everything a .NET access control application needs

OSDP is the SIA standard for communication between access control field devices and the panels that manage them. OSDP.Net puts the whole protocol behind a clean, async .NET API, so you can focus on your application instead of framing, sequencing, and encryption.

  • Proven in production. A mature library that has been running in deployed systems for years.
  • Secure Channel built in. Encrypted, authenticated sessions, including setting unique per-device keys.
  • Async commands. LEDs, buzzers, outputs, text, file transfer, biometrics, PIV data, and more, each a single awaitable call.
  • Events for everything that happens. Card reads, keypad entries, input status changes, NAKs, and connection changes arrive as .NET events.
  • Many devices, one connection. Manage multiple peripheral devices on the same RS-485 bus from one control panel.
  • Pluggable transports. Serial is included; implement IOsdpConnection for anything else.

Up and running in three steps

  1. Install the package

    Add OSDP.Net from NuGet to any project targeting .NET 8 or later, or .NET Framework 4.6.2 or later.

  2. Start a connection

    Create a ControlPanel, register your event handlers, and open a serial connection to the bus.

  3. Add devices and send commands

    Add each peripheral by address, then call commands such as LED, buzzer, and output control.

# .NET CLI
dotnet add package OSDP.Net

# or the Package Manager Console
PM> Install-Package OSDP.Net
// register events before starting the connection
var panel = new ControlPanel();
panel.ConnectionStatusChanged += OnConnectionChanged;

var id = panel.StartConnection(
    new SerialPortOsdpConnection("COM3", 9600));

panel.AddDevice(id, address: 0,
    useCrc: true, useSecureChannel: true);

await panel.ReaderBuzzerControl(id, 0,
    new ReaderBuzzerControl(0, ToneCode.Default, 2, 2, 1));

Try it without compiling code

Self-contained ACU and PD test consoles are available for download. They are a great way to play with OSDP.net. Connect using a USB to RS-485 adapter and start exercising devices.

Downloads need JavaScript and a free Z-bit account. Need a copy another way? Send us a message.

ACU Console

Version 5.3.0-beta.3 ·

Act as a control panel: poll devices, send commands, and watch replies and events.

Beta

PD Console

Version 5.3.0-beta.3 ·

Act as a peripheral device to test a control panel's OSDP implementation.

SHA-256 checksums
ConsolePlatformSHA-256
ACU ConsoleWindows x6449d4689773406cc15f70a4d37c1f21a0c00b2fd47d95b216a13b115baffe553e
ACU ConsolemacOS ARM64452b5aaaa6e01b13d164897a3fe7d148dbe6c2176fd718cda1a27069ba110a98
ACU ConsoleLinux x64168c6547d511be8f7d5aa93a8ac955267eca92bb7c04b3f8670bcd7560c86f64
ACU ConsoleLinux ARM64cdcf5e682fe2ecc968c1d62e57c9b3a3506f01ceb671a9c7821d8ff88933d18b
PD ConsoleWindows x640490293d52cb20dc7984fb822a08c349d1323dc8f222cd10894a2123da223926
PD ConsolemacOS ARM64647163c1425209aa579b4f143a96e9d5b153f29ecae0fb2f744b4d5df312f9e6
PD ConsoleLinux x64eb271485f04776ce48750b7283ce800c511977fbcc39e35b7f35abe7af7be800
PD ConsoleLinux ARM64e7a243875944a710245927689a791c8aad2a94809ae2194baa658f34fd7d263f

Check a download with Get-FileHash <file> on Windows, shasum -a 256 <file> on macOS, or sha256sum <file> on Linux.

Both consoles save each session's packets in their captures folder. Upload an .osdpcap to the capture analyzer for a review against the OSDP specification.

Building on OSDP.Net?

Z-bit Systems built and maintains OSDP.Net. If you need help integrating it, or want to collaborate on the library, get in touch.