Skip to main content

BACnetServer

Struct BACnetServer 

Source
pub struct BACnetServer<T: TransportPort> { /* private fields */ }
Expand description

BACnet server with APDU dispatch and service handling.

Implementations§

Source§

impl<T: TransportPort + 'static> BACnetServer<T>

Source

pub async fn start( config: ServerConfig, db: ObjectDatabase, transport: T, ) -> Result<Self, Error>

Start with the default system-UTC Device clock.

Source

pub async fn start_with_clock( config: ServerConfig, db: ObjectDatabase, transport: T, clock_config: ClockConfig, ) -> Result<Self, Error>

Start with a validated Device clock configuration.

Source

pub async fn start_clockless( config: ServerConfig, db: ObjectDatabase, transport: T, ) -> Result<Self, Error>

Start without a Device wall clock or time-synchronization execution.

Source§

impl<T: TransportPort + 'static> BACnetServer<T>

Source

pub fn local_mac(&self) -> &[u8] ⓘ

Get the server’s local MAC address.

Source

pub fn database(&self) -> &Arc<RwLock<ObjectDatabase>> ⓘ

Get a reference to the shared object database.

Source

pub fn i_am_broadcaster(&self) -> IAmBroadcaster<T>

Create a cloneable handle for unsolicited I-Am announcements.

Source

pub fn comm_state(&self) -> u8

Get the communication state per DeviceCommunicationControl.

Returns 0 (Enable), 1 (Disable), or 2 (DisableInitiation).

Source

pub async fn generate_pics(&self, pics_config: &PicsConfig) -> Pics

Generate a PICS document from the current object database and server configuration.

The caller must supply a [PicsConfig] for fields not available from the server (vendor name, model, firmware revision, etc.).

Source

pub async fn broadcast_i_am(&self) -> Result<(), Error>

Broadcast an I-Am for this server’s Device object using the bound transport socket.

Source§

impl<T: TransportPort + 'static> BACnetServer<T>

Source

pub async fn set_life_safety_operation_expected_local( &self, oid: &ObjectIdentifier, operation: LifeSafetyOperation, ) -> Result<(), Error>

Arm or rearm a Life Safety object from trusted local application logic.

This uses the object-internal state channel under the database write lock. Network WriteProperty and WritePropertyMultiple remain unable to forge Operation_Expected. After the lock is released, an actual Operation_Expected readback change uses the exact Life Safety COV path; rearming to the current value emits no notification.

Source

pub async fn write_local( &self, oid: &ObjectIdentifier, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>

Write a property on a local object and fire the same post-write COV and event notifications that a network WriteProperty does.

This is the server-owned local-mutation entry point: it performs the write under the database lock — routing OBJECT_NAME through the name uniqueness check and index refresh, exactly like the network handler — then releases the lock and runs the COV/event trigger path so a subscription observes a local mutation just as it would a network one. Low-level object setters deliberately bypass this notification owner.

Source

pub async fn set_present_value_local( &self, oid: &ObjectIdentifier, value: PropertyValue, ) -> Result<(), Error>

Supply a supported Input’s logical Present_Value from Rust application code.

Analog Input, Binary Input, and Multi-state Input opt in. Binary values are logical INACTIVE/ACTIVE states after Polarity, not raw physical states. The update runs the existing post-write intrinsic-event and COV processing after the database lock is released; configured delays and distribution policy still determine when notifications are delivered.

Applications are denied while Out_Of_Service is TRUE to protect a client’s simulation value. That ownership rule is local policy, not a Standard mandate. Other object families fail closed; use BACnetServer::write_local for ordinary network-equivalent writes and commandable objects. Python exposure is tracked separately in #503.

Source§

impl<T: TransportPort + 'static> BACnetServer<T>

Source

pub async fn stop(&mut self) -> Result<(), Error>

Stop the server.

Source§

impl BACnetServer<BipTransport>

Source

pub fn bip_builder() -> BipServerBuilder

Create a BIP-specific builder with interface/port/broadcast fields.

Source

pub fn builder() -> BipServerBuilder

Create a BIP-specific builder (alias for backward compatibility).

Source§

impl<T: TransportPort + 'static> BACnetServer<T>

Trait Implementations§

Source§

impl<T: TransportPort> Drop for BACnetServer<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for BACnetServer<T>

§

impl<T> !UnwindSafe for BACnetServer<T>

§

impl<T> Freeze for BACnetServer<T>
where Arc<NetworkLayer<T>>: Freeze,

§

impl<T> Send for BACnetServer<T>
where Arc<NetworkLayer<T>>: Send,

§

impl<T> Sync for BACnetServer<T>
where Arc<NetworkLayer<T>>: Sync,

§

impl<T> Unpin for BACnetServer<T>
where Arc<NetworkLayer<T>>: Unpin,

§

impl<T> UnsafeUnpin for BACnetServer<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more