Expand description
§mabi-bacnet
BACnet/IP simulator for the OTSIM protocol simulator.
This crate provides:
- BACnet/IP server implementation with UDP networking
- BACnet object model (AI, AO, BI, BO, AV, BV, MSI, MSO, MSV, Device)
- Property services (ReadProperty, WriteProperty, ReadPropertyMultiple, WritePropertyMultiple)
- COV subscriptions and notifications
- Device discovery (Who-Is/I-Am)
- BBMD (BACnet Broadcast Management Device) for cross-subnet communication
- APDU segmentation for large message handling
§Architecture
The crate follows a layered architecture:
┌─────────────────────────────────────────────────────────────┐
│ BACnet Server │
│ (Server, Device Management, Event Handling) │
└─────────────────────────────────────────────────────────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Service Layer │ │ Object Model │ │ BBMD │
│ (Handler Reg.) │ │ (Registry) │ │ (Cross-subnet) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ APDU Layer │ │ Property Store │
│ (Segmentation) │ │ (DashMap-based) │
└─────────────────┘ └─────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Network Layer │
│ (UDP, BVLC, NPDU handling) │
└─────────────────────────────────────────────────────────────┘§Quick Start
ⓘ
use mabi_bacnet::prelude::*;
// Create object registry
let mut registry = ObjectRegistry::new();
// Add analog input object
let ai = AnalogInput::new(1, "Zone Temperature");
ai.set_value(72.5);
registry.register(Arc::new(ai));
// Create and run server
let config = ServerConfig::new(1234);
let server = BACnetServer::new(config, registry);
server.run().await?;Re-exports§
pub use config::BacnetServerConfig;pub use device::BacnetDevice;pub use error::BacnetError;pub use error::BacnetResult;pub use runtime::descriptor;pub use runtime::driver;pub use server::BACnetServer;pub use server::ServerConfig;pub use server::ServerEvent;pub use server::ServerMetrics;pub use server::ServerMetricsSnapshot;
Modules§
- apdu
- APDU (Application Protocol Data Unit) encoding and decoding.
- config
- BACnet configuration types.
- device
- BACnet device implementation integrating with the core Device trait.
- error
- BACnet error types.
- network
- BACnet/IP network layer implementation.
- object
- BACnet object model implementation.
- prelude
- runtime
- server
- BACnet/IP server implementation.
- service
- BACnet service implementations.
Structs§
- Builder
- Canonical BACnet server builder.
Type Aliases§
- Config
- Canonical configuration surface for architecture-level composition.
- Device
- Canonical device surface for architecture-level composition.
- Error
- Canonical error surface for architecture-level composition.
- Factory
- Canonical factory surface for architecture-level composition.
- Result
- Canonical result surface for architecture-level composition.
- Server
- Canonical server surface for architecture-level composition.
- Stats
- Canonical stats surface for architecture-level composition.