Skip to main content

Device

Struct Device 

Source
pub struct Device {
Show 17 fields pub identifier: ObjectIdentifier, pub object_name: String, pub object_type: ObjectType, pub system_status: DeviceStatus, pub vendor_name: String, pub vendor_identifier: u16, pub model_name: String, pub firmware_revision: String, pub application_software_version: String, pub protocol_version: u8, pub protocol_revision: u8, pub protocol_services_supported: ProtocolServicesSupported, pub object_types_supported: Vec<ObjectType>, pub max_apdu_length_accepted: u16, pub segmentation_supported: Segmentation, pub device_address_binding: Vec<AddressBinding>, pub database_revision: u32,
}
Expand description

Device object implementation

Fields§

§identifier: ObjectIdentifier

Object identifier

§object_name: String

Object name (required property)

§object_type: ObjectType

Object type (always Device)

§system_status: DeviceStatus

System status

§vendor_name: String

Vendor name

§vendor_identifier: u16

Vendor identifier

§model_name: String

Model name

§firmware_revision: String

Firmware revision

§application_software_version: String

Application software version

§protocol_version: u8

Protocol version (always 1)

§protocol_revision: u8

Protocol revision

§protocol_services_supported: ProtocolServicesSupported

Protocol services supported

§object_types_supported: Vec<ObjectType>

Object types supported

§max_apdu_length_accepted: u16

Maximum APDU length accepted

§segmentation_supported: Segmentation

Segmentation support

§device_address_binding: Vec<AddressBinding>

Device address binding (for routing)

§database_revision: u32

Database revision

Implementations§

Source§

impl Device

Source

pub fn new(instance: u32, object_name: String) -> Self

Create a new Device object

Source

pub fn add_supported_object_type(&mut self, object_type: ObjectType)

Add an object type to the supported list

Source

pub fn get_vendor_info(&self) -> Option<VendorInfo>

Get the vendor information for this device

Source

pub fn get_official_vendor_name(&self) -> Option<&'static str>

Get the official vendor name from the vendor ID

Source

pub fn set_vendor_by_id(&mut self, vendor_id: u16) -> Result<()>

Set vendor information using an official vendor ID

Source

pub fn set_vendor_name(&mut self, name: String)

Set vendor information with custom name (preserves vendor ID)

Source

pub fn is_vendor_id_official(&self) -> bool

Check if the current vendor ID is officially assigned

Source

pub fn is_vendor_id_test(&self) -> bool

Check if the current vendor ID is reserved for testing

Source

pub fn format_vendor_display(&self) -> String

Get a formatted string showing vendor information

Trait Implementations§

Source§

impl BacnetObject for Device

Source§

fn identifier(&self) -> ObjectIdentifier

Get the object identifier
Source§

fn get_property(&self, property: PropertyIdentifier) -> Result<PropertyValue>

Get a property value
Source§

fn set_property( &mut self, property: PropertyIdentifier, value: PropertyValue, ) -> Result<()>

Set a property value
Source§

fn is_property_writable(&self, property: PropertyIdentifier) -> bool

Check if property is writable
Source§

fn property_list(&self) -> Vec<PropertyIdentifier>

Get list of all properties
Source§

impl Clone for Device

Source§

fn clone(&self) -> Device

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.