#acs #sia #osdp #wiegand

no-std libosdp

Library implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol)

11 releases

0.2.0 Dec 17, 2025
0.1.9 Mar 15, 2024
0.1.8 Feb 14, 2024
0.1.7 Jan 28, 2024
0.1.3 Nov 30, 2023

#413 in Embedded development

50 downloads per month
Used in osdpctl

Apache-2.0

2.5MB
19K SLoC

C 14K SLoC // 0.1% comments Rust 2K SLoC // 0.0% comments Python 1.5K SLoC // 0.1% comments Shell 519 SLoC // 0.1% comments Lua 163 SLoC // 0.1% comments Arduino C++ 141 SLoC // 0.1% comments C++ 127 SLoC // 0.1% comments

LibOSDP for Rust

This crate provides safe wrappers for accessing the C library LibOSDP. LibOSDP the most popular open source library for creating Open Supervised Device Protocol (OSDP) devices. For more information about the library or OSDP in general, see libosdp.sidcha.dev.

The documentation for this crate can be found here.

Features

  • Production ready implementation with active users and contributors
  • Supports secure channel communication (AES-128)
  • Can be used to setup a PD or CP mode of operation
  • Most OSDP specified commands and replies are supported (see doc)

Usage

To add libosdp to your rust project, do:

cargo add libosdp

Control Panel:

A simplified CP implementation:

let pd_info = vec! [ PdInfo::new(...), ... ];
let mut cp = ControlPanel::new(&mut pd_info)?;
cp.set_event_callback(|pd, event| {
    println!("Received event from {pd}: {:?}", event);
});
loop {
    cp.refresh();
    cp.send_command(0, OsdpCommand::new(...));
}

See examples for a working implementation.

Peripheral Device:

A simplified PD implementation:

let pd_info = PdInfo::new(...);
let mut pd = PeripheralDevice::new(&mut pd_info)?;
pd.set_command_callback(|cmd| {
    println!("Received command {:?}", cmd);
});
loop {
    pd.refresh();
    cp.notify_event(OsdpEvent::new(...));
}

See examples for a working implementation.

Dependencies