pub struct BACnetClient<T: TransportPort> { /* private fields */ }Expand description
BACnet client with low-level and high-level request APIs.
Implementations§
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn confirmed_audit_notification(
&self,
destination_mac: &[u8],
request: &AuditNotificationRequest,
) -> Result<(), Error>
pub async fn confirmed_audit_notification( &self, destination_mac: &[u8], request: &AuditNotificationRequest, ) -> Result<(), Error>
Send a typed ConfirmedAuditNotification to a directly addressed MAC.
The request uses the existing qualified Clause 21 Audit wire model.
Sourcepub async fn unconfirmed_audit_notification(
&self,
destination_mac: &[u8],
request: &AuditNotificationRequest,
) -> Result<(), Error>
pub async fn unconfirmed_audit_notification( &self, destination_mac: &[u8], request: &AuditNotificationRequest, ) -> Result<(), Error>
Send a typed UnconfirmedAuditNotification to a directly addressed MAC.
The request uses the existing qualified Clause 21 Audit wire model and completes after transport send without waiting for a response.
Sourcepub async fn audit_log_query(
&self,
destination_mac: &[u8],
request: &AuditLogQueryRequest,
) -> Result<AuditLogQueryAck, Error>
pub async fn audit_log_query( &self, destination_mac: &[u8], request: &AuditLogQueryRequest, ) -> Result<AuditLogQueryAck, Error>
Query an Audit Log at a directly addressed MAC and decode its typed ACK.
Request and response use the existing qualified Clause 21 Audit wire model; this helper does not reinterpret query fields or execution.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn subscribe_cov(
&self,
destination_mac: &[u8],
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
confirmed: bool,
lifetime: Option<u32>,
) -> Result<(), Error>
pub async fn subscribe_cov( &self, destination_mac: &[u8], subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, confirmed: bool, lifetime: Option<u32>, ) -> Result<(), Error>
Subscribe to COV notifications for an object at a directly reachable MAC address.
Sourcepub async fn subscribe_cov_to_device(
&self,
device_instance: u32,
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
confirmed: bool,
lifetime: Option<u32>,
) -> Result<(), Error>
pub async fn subscribe_cov_to_device( &self, device_instance: u32, subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, confirmed: bool, lifetime: Option<u32>, ) -> Result<(), Error>
Subscribe to COV notifications for a discovered device, auto-routing if needed.
Sourcepub async fn unsubscribe_cov(
&self,
destination_mac: &[u8],
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
) -> Result<(), Error>
pub async fn unsubscribe_cov( &self, destination_mac: &[u8], subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, ) -> Result<(), Error>
Cancel a COV subscription on a remote device.
Sourcepub async fn unsubscribe_cov_to_device(
&self,
device_instance: u32,
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
) -> Result<(), Error>
pub async fn unsubscribe_cov_to_device( &self, device_instance: u32, subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, ) -> Result<(), Error>
Cancel a COV subscription for a discovered device, auto-routing if needed.
Sourcepub async fn subscribe_cov_property(
&self,
destination_mac: &[u8],
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
monitored_property_identifier: PropertyIdentifier,
monitored_property_array_index: Option<u32>,
confirmed: bool,
lifetime: Option<u32>,
cov_increment: Option<f32>,
) -> Result<(), Error>
pub async fn subscribe_cov_property( &self, destination_mac: &[u8], subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, monitored_property_identifier: PropertyIdentifier, monitored_property_array_index: Option<u32>, confirmed: bool, lifetime: Option<u32>, cov_increment: Option<f32>, ) -> Result<(), Error>
Subscribe to COV notifications for a single property at a directly reachable MAC address.
Sourcepub async fn subscribe_cov_property_to_device(
&self,
device_instance: u32,
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
monitored_property_identifier: PropertyIdentifier,
monitored_property_array_index: Option<u32>,
confirmed: bool,
lifetime: Option<u32>,
cov_increment: Option<f32>,
) -> Result<(), Error>
pub async fn subscribe_cov_property_to_device( &self, device_instance: u32, subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, monitored_property_identifier: PropertyIdentifier, monitored_property_array_index: Option<u32>, confirmed: bool, lifetime: Option<u32>, cov_increment: Option<f32>, ) -> Result<(), Error>
Subscribe to COV notifications for a single property on a discovered device, auto-routing if needed.
Sourcepub async fn unsubscribe_cov_property(
&self,
destination_mac: &[u8],
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
monitored_property_identifier: PropertyIdentifier,
monitored_property_array_index: Option<u32>,
) -> Result<(), Error>
pub async fn unsubscribe_cov_property( &self, destination_mac: &[u8], subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, monitored_property_identifier: PropertyIdentifier, monitored_property_array_index: Option<u32>, ) -> Result<(), Error>
Cancel a single-property COV subscription at a directly reachable MAC address.
Sourcepub async fn unsubscribe_cov_property_to_device(
&self,
device_instance: u32,
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
monitored_property_identifier: PropertyIdentifier,
monitored_property_array_index: Option<u32>,
) -> Result<(), Error>
pub async fn unsubscribe_cov_property_to_device( &self, device_instance: u32, subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, monitored_property_identifier: PropertyIdentifier, monitored_property_array_index: Option<u32>, ) -> Result<(), Error>
Cancel a single-property COV subscription for a discovered device, auto-routing if needed.
Sourcepub fn cov_notifications(&self) -> Receiver<ReceivedCOVNotification>
pub fn cov_notifications(&self) -> Receiver<ReceivedCOVNotification>
Get a receiver for incoming COV notifications. Each call returns a new independent receiver.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn manage_cov_subscription(
self: Arc<Self>,
destination_mac: &[u8],
subscriber_process_identifier: u32,
monitored_object_identifier: ObjectIdentifier,
confirmed: bool,
lifetime: u32,
options: ManagedCOVSubscriptionOptions,
) -> Result<ManagedCOVSubscription, Error>
pub async fn manage_cov_subscription( self: Arc<Self>, destination_mac: &[u8], subscriber_process_identifier: u32, monitored_object_identifier: ObjectIdentifier, confirmed: bool, lifetime: u32, options: ManagedCOVSubscriptionOptions, ) -> Result<ManagedCOVSubscription, Error>
Start a managed finite SubscribeCOV renewal task for a directly reachable device.
The helper sends the initial SubscribeCOV request, then renews the same
subscription before expiry. It also listens to Self::cov_notifications
and moves the renewal earlier when matching notifications report a lower
time_remaining than the requested lifetime-based schedule.
This method takes Arc<Self> so the renewal task can keep the client alive.
Call it as Arc::clone(&client).manage_cov_subscription(...).
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub fn device_events(&self) -> Receiver<DeviceEvent>
pub fn device_events(&self) -> Receiver<DeviceEvent>
Get a receiver for device discovery events. Each call returns a new independent receiver.
Events are notification-only; discovered_devices() remains the
authoritative snapshot of the current discovery table.
Sourcepub fn device_collision_events(&self) -> Receiver<DeviceCollisionEvent>
pub fn device_collision_events(&self) -> Receiver<DeviceCollisionEvent>
Get a receiver for Device-instance collision notifications. Each call returns a new independent receiver.
Delivery is notification-only and best-effort: receivers can lag and
missed notifications do not affect collision handling. The retained
snapshot identifies the discovery-table row that remains authoritative;
the conflicting incoming snapshot is not installed in the table.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn device_communication_control(
&self,
destination_mac: &[u8],
enable_disable: EnableDisable,
time_duration: Option<u16>,
password: Option<String>,
) -> Result<(), Error>
pub async fn device_communication_control( &self, destination_mac: &[u8], enable_disable: EnableDisable, time_duration: Option<u16>, password: Option<String>, ) -> Result<(), Error>
Send DeviceCommunicationControl to a remote device.
Sourcepub async fn reinitialize_device(
&self,
destination_mac: &[u8],
reinitialized_state: ReinitializedState,
password: Option<String>,
) -> Result<(), Error>
pub async fn reinitialize_device( &self, destination_mac: &[u8], reinitialized_state: ReinitializedState, password: Option<String>, ) -> Result<(), Error>
Send ReinitializeDevice to a remote device.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn who_is(
&self,
low_limit: Option<u32>,
high_limit: Option<u32>,
) -> Result<(), Error>
pub async fn who_is( &self, low_limit: Option<u32>, high_limit: Option<u32>, ) -> Result<(), Error>
Read a property from multiple discovered devices concurrently.
All requests are dispatched concurrently (up to max_concurrent,
default 32) and results are returned in completion order. Each device
is resolved from the device table and auto-routed if behind a router.
Send a WhoIs broadcast to discover devices.
Sourcepub async fn who_is_directed(
&self,
destination_mac: &[u8],
low_limit: Option<u32>,
high_limit: Option<u32>,
) -> Result<(), Error>
pub async fn who_is_directed( &self, destination_mac: &[u8], low_limit: Option<u32>, high_limit: Option<u32>, ) -> Result<(), Error>
Send a directed (unicast) WhoIs to a specific device.
Sourcepub async fn who_is_network(
&self,
dest_network: u16,
low_limit: Option<u32>,
high_limit: Option<u32>,
) -> Result<(), Error>
pub async fn who_is_network( &self, dest_network: u16, low_limit: Option<u32>, high_limit: Option<u32>, ) -> Result<(), Error>
Send a WhoIs broadcast to a specific remote network.
Sourcepub async fn who_has(
&self,
object: WhoHasObject,
low_limit: Option<u32>,
high_limit: Option<u32>,
) -> Result<(), Error>
pub async fn who_has( &self, object: WhoHasObject, low_limit: Option<u32>, high_limit: Option<u32>, ) -> Result<(), Error>
Send a WhoHas broadcast to find an object by identifier or name.
Sourcepub async fn discovered_devices(&self) -> Vec<DiscoveredDevice>
pub async fn discovered_devices(&self) -> Vec<DiscoveredDevice>
Subscribe to COV notifications for an object on a remote device. Get a snapshot of all discovered devices.
Sourcepub async fn get_device(&self, instance: u32) -> Option<DiscoveredDevice>
pub async fn get_device(&self, instance: u32) -> Option<DiscoveredDevice>
Look up a discovered device by instance number.
Sourcepub async fn clear_devices(&self)
pub async fn clear_devices(&self)
Clear the discovered devices table.
Sourcepub async fn add_device(&self, instance: u32, mac: &[u8]) -> Result<(), Error>
pub async fn add_device(&self, instance: u32, mac: &[u8]) -> Result<(), Error>
Manually register a local device in the device table.
Useful for adding known devices without requiring WhoIs/IAm exchange. The metadata defaults below (max_apdu_length 1476, segmentation NONE, vendor_id 0) are local/manual registration defaults, not values learned from an I-Am; requests to this device are bounded by them until a real I-Am refreshes the row. The row is unambiguously local: routed lookups by SNET/SADR will not match it.
Sourcepub async fn add_routed_device(
&self,
config: RoutedDeviceConfig,
) -> Result<(), Error>
pub async fn add_routed_device( &self, config: RoutedDeviceConfig, ) -> Result<(), Error>
Manually register a routed peer whose address and capabilities are already known, without fabricating an I-Am exchange.
router_mac is only the immediate transport next hop (Clause 6.2.2);
the peer’s identity is the (remote_network, remote_mac) SNET/SADR
pair, which is what BACnetClient::confirmed_request_routed and the
device-table routed lookup match against. The supplied Max APDU
Length Accepted, segmentation capability, and optional Max Segments
Accepted are treated as advertised peer limits for request sizing.
Vendor ID is recorded as 0 when unknown; this does not affect routing or request-size decisions.
Malformed routing metadata is rejected deliberately: an empty
router_mac or remote_mac cannot identify a next hop or a peer, so
such a registration returns Error::Encoding and the table is left
unchanged (an empty SADR could never satisfy a routed lookup).
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn get_event_information(
&self,
destination_mac: &[u8],
last_received_object_identifier: Option<ObjectIdentifier>,
) -> Result<Bytes, Error>
pub async fn get_event_information( &self, destination_mac: &[u8], last_received_object_identifier: Option<ObjectIdentifier>, ) -> Result<Bytes, Error>
Get event information from a remote device.
Sourcepub async fn acknowledge_alarm_request(
&self,
destination_mac: &[u8],
request: &AcknowledgeAlarmRequest,
) -> Result<(), Error>
pub async fn acknowledge_alarm_request( &self, destination_mac: &[u8], request: &AcknowledgeAlarmRequest, ) -> Result<(), Error>
Send a caller-supplied AcknowledgeAlarm request without fabricating fields.
Sourcepub async fn acknowledge_alarm(
&self,
destination_mac: &[u8],
acknowledging_process_identifier: u32,
event_object_identifier: ObjectIdentifier,
event_state_acknowledged: u32,
acknowledgment_source: &str,
) -> Result<(), Error>
👎Deprecated: use acknowledge_alarm_request with caller-supplied correlation timestamps
pub async fn acknowledge_alarm( &self, destination_mac: &[u8], acknowledging_process_identifier: u32, event_object_identifier: ObjectIdentifier, event_state_acknowledged: u32, acknowledgment_source: &str, ) -> Result<(), Error>
use acknowledge_alarm_request with caller-supplied correlation timestamps
Acknowledge an alarm on a remote device.
This compatibility helper fabricates sequence-zero timestamps, which
are not a valid general correlation mechanism. Use
Self::acknowledge_alarm_request with the original notification’s
exact timestamp and a caller-selected acknowledgment time.
Sourcepub async fn read_range(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
range: Option<RangeSpec>,
) -> Result<ReadRangeAck, Error>
pub async fn read_range( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, range: Option<RangeSpec>, ) -> Result<ReadRangeAck, Error>
Read a range of items from a list or log-buffer property.
Sourcepub async fn atomic_read_file(
&self,
destination_mac: &[u8],
file_identifier: ObjectIdentifier,
access: FileAccessMethod,
) -> Result<Bytes, Error>
pub async fn atomic_read_file( &self, destination_mac: &[u8], file_identifier: ObjectIdentifier, access: FileAccessMethod, ) -> Result<Bytes, Error>
Read file data from a remote device (stream or record access).
Sourcepub async fn atomic_read_file_decoded(
&self,
destination_mac: &[u8],
file_identifier: ObjectIdentifier,
access: FileAccessMethod,
) -> Result<AtomicReadFileAck, Error>
pub async fn atomic_read_file_decoded( &self, destination_mac: &[u8], file_identifier: ObjectIdentifier, access: FileAccessMethod, ) -> Result<AtomicReadFileAck, Error>
Read and strictly decode one AtomicReadFile ACK window.
This additive typed boundary validates that the ACK uses the requested
stream/record access arm and does not return more octets or records than
requested. Use Self::atomic_read_file when the raw encoded service
payload is required for compatibility.
Sourcepub async fn atomic_write_file(
&self,
destination_mac: &[u8],
file_identifier: ObjectIdentifier,
access: FileWriteAccessMethod,
) -> Result<Bytes, Error>
pub async fn atomic_write_file( &self, destination_mac: &[u8], file_identifier: ObjectIdentifier, access: FileWriteAccessMethod, ) -> Result<Bytes, Error>
Write file data to a remote device (stream or record access).
Sourcepub async fn add_list_element(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
list_of_elements: Vec<u8>,
) -> Result<(), Error>
pub async fn add_list_element( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, list_of_elements: Vec<u8>, ) -> Result<(), Error>
Add elements to a list property on a remote device.
Sourcepub async fn remove_list_element(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
list_of_elements: Vec<u8>,
) -> Result<(), Error>
pub async fn remove_list_element( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, list_of_elements: Vec<u8>, ) -> Result<(), Error>
Remove elements from a list property on a remote device.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn start(config: ClientConfig, transport: T) -> Result<Self, Error>
pub async fn start(config: ClientConfig, transport: T) -> Result<Self, Error>
Start the client: bind transport, start network layer, spawn dispatch.
Sourcepub async fn start_with_options(
config: ClientConfig,
transport: T,
options: ClientOptions,
) -> Result<Self, Error>
pub async fn start_with_options( config: ClientConfig, transport: T, options: ClientOptions, ) -> Result<Self, Error>
Start the client with additional startup options.
Sourcepub fn max_apdu_length(&self) -> u16
pub fn max_apdu_length(&self) -> u16
Current BACnet max-APDU bucket advertised by this client.
Returns 0 if the live transport budget is below the smallest BACnet
max-APDU bucket and a confirmed request would currently fail before
encoding.
Sourcepub fn transport_max_apdu_length(&self) -> u16
pub fn transport_max_apdu_length(&self) -> u16
Current APDU payload budget reported by the underlying transport.
For BACnet/SC this reflects the negotiated hub envelope after connect and may be lower than the encoded BACnet max-APDU bucket advertised by the client.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
pub async fn delete_object( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, ) -> Result<(), Error>
Sourcepub async fn create_object(
&self,
destination_mac: &[u8],
object_specifier: ObjectSpecifier,
initial_values: Vec<BACnetPropertyValue>,
) -> Result<Bytes, Error>
pub async fn create_object( &self, destination_mac: &[u8], object_specifier: ObjectSpecifier, initial_values: Vec<BACnetPropertyValue>, ) -> Result<Bytes, Error>
Create an object on a remote device.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn read_property(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
) -> Result<ReadPropertyACK, Error>
pub async fn read_property( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, ) -> Result<ReadPropertyACK, Error>
Read a property from a remote device.
Sourcepub async fn read_property_from_device(
&self,
device_instance: u32,
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
) -> Result<ReadPropertyACK, Error>
pub async fn read_property_from_device( &self, device_instance: u32, object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, ) -> Result<ReadPropertyACK, Error>
Read a property from a discovered device, auto-routing if needed.
Sourcepub async fn read_property_routed(
&self,
router_mac: &[u8],
dest_network: u16,
dest_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
) -> Result<ReadPropertyACK, Error>
pub async fn read_property_routed( &self, router_mac: &[u8], dest_network: u16, dest_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, ) -> Result<ReadPropertyACK, Error>
Read a property from a device on a remote BACnet network via a router.
Sourcepub async fn read_property_multiple(
&self,
destination_mac: &[u8],
specs: Vec<ReadAccessSpecification>,
) -> Result<ReadPropertyMultipleACK, Error>
pub async fn read_property_multiple( &self, destination_mac: &[u8], specs: Vec<ReadAccessSpecification>, ) -> Result<ReadPropertyMultipleACK, Error>
Read multiple properties from one or more objects on a remote device.
Sourcepub async fn read_property_multiple_from_device(
&self,
device_instance: u32,
specs: Vec<ReadAccessSpecification>,
) -> Result<ReadPropertyMultipleACK, Error>
pub async fn read_property_multiple_from_device( &self, device_instance: u32, specs: Vec<ReadAccessSpecification>, ) -> Result<ReadPropertyMultipleACK, Error>
Read multiple properties from a discovered device, auto-routing if needed.
Sourcepub async fn read_property_from_devices(
&self,
requests: Vec<DeviceReadRequest>,
max_concurrent: Option<usize>,
) -> Vec<DeviceReadResult>
pub async fn read_property_from_devices( &self, requests: Vec<DeviceReadRequest>, max_concurrent: Option<usize>, ) -> Vec<DeviceReadResult>
Read one property from multiple discovered devices concurrently.
All reads are dispatched concurrently (up to max_concurrent,
default 32). Results are returned in completion order.
Sourcepub async fn read_property_multiple_from_devices(
&self,
requests: Vec<DeviceRpmRequest>,
max_concurrent: Option<usize>,
) -> Vec<DeviceRpmResult>
pub async fn read_property_multiple_from_devices( &self, requests: Vec<DeviceRpmRequest>, max_concurrent: Option<usize>, ) -> Vec<DeviceRpmResult>
Read multiple properties from multiple devices concurrently (RPM batch).
Sends an RPM to each device concurrently. This is the most efficient way to poll many properties across many devices — RPM batches within a single device, and this method batches across devices.
Sourcepub async fn write_property(
&self,
destination_mac: &[u8],
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
property_value: Vec<u8>,
priority: Option<u8>,
) -> Result<(), Error>
pub async fn write_property( &self, destination_mac: &[u8], object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, property_value: Vec<u8>, priority: Option<u8>, ) -> Result<(), Error>
Write a property on a remote device.
Sourcepub async fn write_property_multiple(
&self,
destination_mac: &[u8],
specs: Vec<WriteAccessSpecification>,
) -> Result<(), Error>
pub async fn write_property_multiple( &self, destination_mac: &[u8], specs: Vec<WriteAccessSpecification>, ) -> Result<(), Error>
Write multiple properties on one or more objects on a remote device.
Sourcepub async fn write_property_to_device(
&self,
device_instance: u32,
object_identifier: ObjectIdentifier,
property_identifier: PropertyIdentifier,
property_array_index: Option<u32>,
property_value: Vec<u8>,
priority: Option<u8>,
) -> Result<(), Error>
pub async fn write_property_to_device( &self, device_instance: u32, object_identifier: ObjectIdentifier, property_identifier: PropertyIdentifier, property_array_index: Option<u32>, property_value: Vec<u8>, priority: Option<u8>, ) -> Result<(), Error>
Write a property on a discovered device, auto-routing if needed.
Sourcepub async fn write_property_multiple_to_device(
&self,
device_instance: u32,
specs: Vec<WriteAccessSpecification>,
) -> Result<(), Error>
pub async fn write_property_multiple_to_device( &self, device_instance: u32, specs: Vec<WriteAccessSpecification>, ) -> Result<(), Error>
Write multiple properties on a discovered device, auto-routing if needed.
Sourcepub async fn write_property_to_devices(
&self,
requests: Vec<DeviceWriteRequest>,
max_concurrent: Option<usize>,
) -> Vec<DeviceWriteResult>
pub async fn write_property_to_devices( &self, requests: Vec<DeviceWriteRequest>, max_concurrent: Option<usize>, ) -> Vec<DeviceWriteResult>
Write one property on multiple discovered devices concurrently.
All writes are dispatched concurrently (up to max_concurrent,
default 32). Results are returned in completion order.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn confirmed_request(
&self,
destination_mac: &[u8],
service_choice: ConfirmedServiceChoice,
service_data: &[u8],
) -> Result<Bytes, Error>
pub async fn confirmed_request( &self, destination_mac: &[u8], service_choice: ConfirmedServiceChoice, service_data: &[u8], ) -> Result<Bytes, Error>
Send a confirmed request and wait for the response.
Returns the service response data (empty for SimpleAck). Automatically uses segmented transfer when the payload exceeds the remote device’s max APDU length.
Sourcepub async fn confirmed_request_routed(
&self,
router_mac: &[u8],
dest_network: u16,
dest_mac: &[u8],
service_choice: ConfirmedServiceChoice,
service_data: &[u8],
) -> Result<Bytes, Error>
pub async fn confirmed_request_routed( &self, router_mac: &[u8], dest_network: u16, dest_mac: &[u8], service_choice: ConfirmedServiceChoice, service_data: &[u8], ) -> Result<Bytes, Error>
Send a confirmed request routed through a BACnet router.
The NPDU is sent as a unicast to router_mac with DNET/DADR set so
the router forwards it to dest_network/dest_mac.
Sourcepub async fn unconfirmed_request(
&self,
destination_mac: &[u8],
service_choice: UnconfirmedServiceChoice,
service_data: &[u8],
) -> Result<(), Error>
pub async fn unconfirmed_request( &self, destination_mac: &[u8], service_choice: UnconfirmedServiceChoice, service_data: &[u8], ) -> Result<(), Error>
Send an unconfirmed request (fire-and-forget) to a specific destination.
Sourcepub async fn broadcast_unconfirmed(
&self,
service_choice: UnconfirmedServiceChoice,
service_data: &[u8],
) -> Result<(), Error>
pub async fn broadcast_unconfirmed( &self, service_choice: UnconfirmedServiceChoice, service_data: &[u8], ) -> Result<(), Error>
Broadcast an unconfirmed request on the local network.
Sourcepub async fn broadcast_global_unconfirmed(
&self,
service_choice: UnconfirmedServiceChoice,
service_data: &[u8],
) -> Result<(), Error>
pub async fn broadcast_global_unconfirmed( &self, service_choice: UnconfirmedServiceChoice, service_data: &[u8], ) -> Result<(), Error>
Broadcast an unconfirmed request globally (DNET=0xFFFF).
Sourcepub async fn broadcast_network_unconfirmed(
&self,
service_choice: UnconfirmedServiceChoice,
service_data: &[u8],
dest_network: u16,
) -> Result<(), Error>
pub async fn broadcast_network_unconfirmed( &self, service_choice: UnconfirmedServiceChoice, service_data: &[u8], dest_network: u16, ) -> Result<(), Error>
Broadcast an unconfirmed request to a specific remote network.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub async fn configure_routed_path_max_npdu(
&self,
router_mac: &[u8],
dnet: u16,
max_npdu: u16,
) -> Result<(), Error>
pub async fn configure_routed_path_max_npdu( &self, router_mac: &[u8], dnet: u16, max_npdu: u16, ) -> Result<(), Error>
Configure the maximum NPDU for one immediate-router/DNET path.
The update waits for any request already active on the same path. It replaces the previous configured value and deliberately clears learned reason-4 evidence for that path.
Sourcepub async fn clear_routed_path_limit(
&self,
router_mac: &[u8],
dnet: u16,
) -> Result<(), Error>
pub async fn clear_routed_path_limit( &self, router_mac: &[u8], dnet: u16, ) -> Result<(), Error>
Restore one immediate-router/DNET path to the conservative default.
The update waits for an active request and clears both configured and learned reason-4 evidence. Later requests therefore use the 228-octet conservative routed NPDU envelope until new evidence is supplied.
Source§impl BACnetClient<BipTransport>
impl BACnetClient<BipTransport>
Sourcepub fn bip_builder() -> BipClientBuilder
pub fn bip_builder() -> BipClientBuilder
Create a BIP-specific builder with interface/port/broadcast fields.
pub fn builder() -> BipClientBuilder
Sourcepub async fn read_bdt(&self, target: &[u8]) -> Result<Vec<BdtEntry>, Error>
pub async fn read_bdt(&self, target: &[u8]) -> Result<Vec<BdtEntry>, Error>
Read the Broadcast Distribution Table from a BBMD.
Sourcepub async fn write_bdt(
&self,
target: &[u8],
entries: &[BdtEntry],
) -> Result<BvlcResultCode, Error>
pub async fn write_bdt( &self, target: &[u8], entries: &[BdtEntry], ) -> Result<BvlcResultCode, Error>
Write the Broadcast Distribution Table to a BBMD.
Sourcepub async fn read_fdt(&self, target: &[u8]) -> Result<Vec<FdtEntryWire>, Error>
pub async fn read_fdt(&self, target: &[u8]) -> Result<Vec<FdtEntryWire>, Error>
Read the Foreign Device Table from a BBMD.
Sourcepub async fn delete_fdt_entry(
&self,
target: &[u8],
ip: [u8; 4],
port: u16,
) -> Result<BvlcResultCode, Error>
pub async fn delete_fdt_entry( &self, target: &[u8], ip: [u8; 4], port: u16, ) -> Result<BvlcResultCode, Error>
Delete a Foreign Device Table entry on a BBMD.
Sourcepub async fn register_foreign_device_bvlc(
&self,
target: &[u8],
ttl: u16,
) -> Result<BvlcResultCode, Error>
pub async fn register_foreign_device_bvlc( &self, target: &[u8], ttl: u16, ) -> Result<BvlcResultCode, Error>
Register as a foreign device with a BBMD and return the result code.
Source§impl<T: TransportPort + 'static> BACnetClient<T>
impl<T: TransportPort + 'static> BACnetClient<T>
Sourcepub fn generic_builder() -> ClientBuilder<T>
pub fn generic_builder() -> ClientBuilder<T>
Create a generic builder that accepts a pre-built transport.