pub struct BACnetAddress {
pub network_number: u16,
pub mac_address: MacAddr,
}Expand description
A BACnet network address: network number (0 = local) plus MAC address.
Fields§
§network_number: u16Network number (0 = local network, 1-65534 = remote, 65535 = broadcast).
mac_address: MacAddrMAC-layer address (variable length, at most Self::MAX_MAC_LEN on the
wire; empty = broadcast).
Implementations§
Source§impl BACnetAddress
impl BACnetAddress
Sourcepub const MAX_MAC_LEN: usize = bacnet_npdu::MAX_MAC_LEN
pub const MAX_MAC_LEN: usize = bacnet_npdu::MAX_MAC_LEN
The longest mac_address, in octets, that this stack encodes or decodes
in any BACnetAddress (#1124, #1156): bacnet-npdu’s
MAX_MAC_LEN, the bound on every DADR,
SADR and link MAC (#1141), where the reasons for 18 are given.
Clause 21 puts no length on the OCTET STRING, but a MAC is only useful
if it names a node on some data link. Every codec for this type in
bacnet-encoding holds to the bound: the recipient, ValueSource and
AuditLogQuery decoders refuse a longer MAC and their encoders refuse to
write one. The local setters that store a configured recipient (a
Recipient_List destination or the Audit_Notification_Recipient) refuse
one too, so a stored recipient always decodes again. The NPDU codec
refuses a longer DLEN or SLEN, and bacnet-network’s NetworkLayer and
BACnetRouter drop a frame whose link-layer source MAC is longer
(#1198), so the source addresses the stack learns off the network, which
COV subscription lists and audit records report, fit the bound as well.
So does the device MAC a You-Are request assigns (#1200).
Sourcepub fn local_broadcast() -> Self
pub fn local_broadcast() -> Self
Create a local-broadcast address.