BACnet.Protocol.ObjectTypes.NetworkPort (bacstack v0.1.0-dev.1)

Copy Markdown View Source

The Network Port object type defines a standardized object whose properties represent the externally visible characteristics of a network port of a BACnet device. All BACnet devices shall contain at least one Network Port object per configured port. It is a local matter whether or not Network Port objects exist for non-configured ports. It is a local matter whether or not the Network Port object is used for non-BACnet ports.

Verification and validation of property values within a Network Port object is a local matter. Property values which are required to maintain proper operation of the network shall be retained across a device reset.

Network Port objects may optionally support intrinsic reporting to facilitate the reporting of fault conditions. Network Port objects that support intrinsic reporting shall apply the NONE event algorithm.

As specified in the standard (ASHRAE 135-2016, Clause 12.56), some properties of the Network Port object are required if the object is used to represent a network of a given type and protocol level. For example, a Network Port object whose Network_Type is MSTP must include the Max_Master property (when applicable), and a Network Port object whose Network_Type is IPV4 must include the BACnet_IP_Subnet_Mask property (when Protocol_Level is BACNET_APPLICATION).

Aside from the properties so required, it is a local matter whether a Network Port object contains properties that do not apply to its Network_Type. Some vendors may find it convenient to have all of their Network Port objects support the same list of properties regardless of Network_Type. This is permitted, but not required.

Object Description (ASHRAE 135-2016)

The Network Port object provides access to the configuration and properties of network ports of a device. All BACnet devices shall contain one Network Port object per configured port. It is a local matter whether or not Network Port objects exist for non-configured ports. It is a local matter whether or not the Network Port object is used for non-BACnet ports.

It is suggested that instances greater than 255 be used for Network Port objects with a Protocol_Level of PHYSICAL or PROTOCOL. When the Protocol_Level property has a value of BACNET_APPLICATION, the instance number (see Clause 20.2.14) shall correspond to the Port ID of the associated network as described in Clause 6.

Behaviour and Operation

The Network Port object is used to configure and monitor the network interfaces of a BACnet device. Changes to many properties set the Changes_Pending property to TRUE. The Command property is used to apply pending changes (or discard them, renew DHCP, restart the port, etc.).

Properties such as Network_Number must be retained across resets for routers and other devices that require knowledge of the network number. Many properties are conditional on Network_Type and Protocol_Level.

Developer Implementation Notes (geared to device server / application authors)

The generated code handles storage + basic mechanics (validation, implicit_relationships, readonly annotations as hints to your server, etc.). You must drive "special" live properties and side effects yourself via update_property/3 (never direct mutation).

Special / live properties and expected developer behaviour

  • changes_pending: Set to true when configuration properties are written that require activation via Command. Dev must: Clear it when Command is written with appropriate value (e.g. discard_changes or restart_port that applies changes). This flag is automatically set to true when a configuration property is written (using update_property/3), as specified by ASHRAE 135-2016.

  • command: Writing a value other than :idle causes the device to perform the action (discard pending changes, renew FD registration, renew DHCP, restart autonegotiation, disconnect, restart port, etc.). After processing, the property reverts to :idle. Dev must: Implement the side effects of each command value and update related properties (e.g. after renew_dhcp update IP related properties).

  • network_number, network_number_quality: Critical for routers. Dev must: Persist network_number across restarts; update quality appropriately (configured vs learned).

  • mac_address, apdu_length, link_speed, link_speeds, IP/MS/TP specific properties: Changes often require port restart / application of configuration. Dev must: When writing configuration properties, set changes_pending = true. On successful Command (apply/restart), push the configuration into the lower-layer transport (IPv4Transport, MstpTransport, etc.) and clear changes_pending.

  • status_flags, reliability, out_of_service: Dev must: Keep reliability up to date based on the actual health of the physical/ logical port (no_fault_detected, communication_failure, etc.). The fault bit of status_flags is maintained automatically. out_of_service suspends use of the port.

  • BBMD / Foreign Device properties (bbmd_*, fd_*): Dev must: Keep the tables in sync with the actual BBMD/FD implementation state. Writing to the tables or enabling BBMD usually sets changes_pending.

  • Intrinsic reporting (optional): Uses the NONE event algorithm. Only fault conditions (via reliability) generate events.

Creation: create(instance, name, %{network_type: :ipv4, protocol_level: :bacnet_application, ...}, ...)

See the generated tables at the end of the moduledoc for the full list of properties, their types, defaults, and annotations.

See Also

  • ASHRAE Standard 135-2016 Clause 12.56 Network Port Object Type
  • Addendum ai to 135-2012 (introduction of the object)


The following part has been automatically generated.

Click to expand This module defines a BACnet object of the type `network_port`. The following properties are defined: | Property | Revision | Required | Readonly | Protected | Intrinsic | |----------|----------|----------|----------|-----------|-----------| | acked_transitions | | | X | | X | | apdu_length | | | X | | | | auto_slave_discovery | | | | | | | bacnet_ip_global_address | | | | | | | bacnet_ip_mode | | | | | | | bacnet_ip_multicast_address | | | | | | | bacnet_ip_nat_traversal | | | | | | | bacnet_ip_udp_port | | | | | | | bacnet_ipv6_mode | | | | | | | bacnet_ipv6_multicast_address | | | | | | | bacnet_ipv6_udp_port | | | | | | | bbmd_accept_fd_registrations | | | | | | | bbmd_broadcast_distribution_table | | | | | | | bbmd_foreign_device_table | | | X | | | | changes_pending | | X | X | | | | command | | | | | | | description | | | | | | | event_algorithm_inhibit | | | | | X | | event_algorithm_inhibit_ref | | | | | X | | event_detection_enable | | | | | X | | event_enable | | | | | X | | event_message_texts | | | X | | X | | event_message_texts_config | | | | | X | | event_timestamps | | | X | | X | | fd_bbmd_address | | | | | | | fd_subscription_lifetime | | | | | | | ip_address | | | | | | | ip_default_gateway | | | | | | | ip_dhcp_enable | | | | | | | ip_dhcp_lease_time | | | X | | | | ip_dhcp_lease_time_remaining | | | X | | | | ip_dhcp_server | | | X | | | | ip_dns_server | | | | | | | ip_subnet_mask | | | | | | | ipv6_address | | | | | | | ipv6_auto_addressing_enable | | | | | | | ipv6_default_gateway | | | | | | | ipv6_dhcp_lease_time | | | X | | | | ipv6_dhcp_lease_time_remaining | | | X | | | | ipv6_dhcp_server | | | | | | | ipv6_dns_server | | | | | | | ipv6_prefix_length | | | | | | | ipv6_zone_index | | | | | | | limit_enable | | | | | X | | link_speed | | | | | | | link_speed_autonegotiate | | | | | | | link_speeds | | | X | | | | mac_address | | | | | | | manual_slave_address_binding | | | | | | | max_info_frames | | | | | | | max_master | | | X | | | | network_interface_name | | | X | | | | network_number | | | | | | | network_number_quality | | | X | | | | network_type | | X | X | | | | notification_class | | | | | X | | notify_type | | | | | X | | object_instance | | X | X | | | | object_name | | X | X | | | | out_of_service | | | | | | | profile_location | 19 | | | | | | profile_name | | | | | | | protocol_level | | X | X | | | | reference_port | | | | | | | reliability | | | | | | | reliability_evaluation_inhibit | | | | | | | routing_table | | | X | | | | slave_address_binding | | | X | | | | slave_proxy_enable | | | | | | | status_flags | | X | X | | | | tags | 19 | | | | | | time_delay | | | | | X | | time_delay_normal | | | | | X | | virtual_mac_address_table | | | | | | The following properties have additional semantics: | Property | Has Default | Has Init | Implicit Relationships | Validators | Annotations | |----------|-------------|----------|------------------------|------------|-------------| | apdu_length | X | | | | `required_when: {:fn, [line: 221, column: 24], [{:->, [line: 221, column: 42], [[{:props, [line: 221, column: 27], nil}, {:_object, [line: 221, column: 34], nil}], {:in, [line: 222, column: 43], [{{:., [line: 222, column: 14], [{:__aliases__, [line: 222, column: 11], [:Map]}, :get]}, [line: 222, column: 15], [{:props, [line: 222, column: 19], nil}, :protocol_level]}, [:bacnet_application, :non_bacnet_application]]}]}]}` | | auto_slave_discovery | | | slave_proxy_enable | | | | bacnet_ip_global_address | | | | | `required_when: {:fn, [line: 343, column: 24], [{:->, [line: 343, column: 42], [[{:props, [line: 343, column: 27], nil}, {:_object, [line: 343, column: 34], nil}], {:==, [line: 344, column: 52], [{{:., [line: 344, column: 14], [{:__aliases__, [line: 344, column: 11], [:Map]}, :get]}, [line: 344, column: 15], [{:props, [line: 344, column: 19], nil}, :bacnet_ip_nat_traversal]}, true]}]}]}` | | bacnet_ip_mode | | | | | `required_when: {:fn, [line: 253, column: 24], [{:->, [line: 253, column: 42], [[{:props, [line: 253, column: 27], nil}, {:_object, [line: 253, column: 34], nil}], {:==, [line: 254, column: 41], [{{:., [line: 254, column: 14], [{:__aliases__, [line: 254, column: 11], [:Map]}, :get]}, [line: 254, column: 15], [{:props, [line: 254, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | bacnet_ip_multicast_address | | | | | `decoder: {:&, [line: 300, column: 18], [{:decode_ipv4_address, [line: 300, column: 19], [:bacnet_ip_multicast_address, {:&, [line: 300, column: 69], [1]}]}]}, encoder: {:&, [line: 301, column: 18], [{:encode_ipv4_address, [line: 301, column: 19], [:bacnet_ip_multicast_address, {:&, [line: 301, column: 69], [1]}]}]}` | | bacnet_ip_udp_port | | | | Type | `required_when: {:fn, [line: 261, column: 24], [{:->, [line: 261, column: 42], [[{:props, [line: 261, column: 27], nil}, {:_object, [line: 261, column: 34], nil}], {:==, [line: 262, column: 41], [{{:., [line: 262, column: 14], [{:__aliases__, [line: 262, column: 11], [:Map]}, :get]}, [line: 262, column: 15], [{:props, [line: 262, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | bacnet_ipv6_mode | | | | | `required_when: {:fn, [line: 382, column: 24], [{:->, [line: 382, column: 42], [[{:props, [line: 382, column: 27], nil}, {:_object, [line: 382, column: 34], nil}], {:and, [line: 383, column: 50], [{:==, [line: 383, column: 41], [{{:., [line: 383, column: 14], [{:__aliases__, [line: 383, column: 11], [:Map]}, :get]}, [line: 383, column: 15], [{:props, [line: 383, column: 19], nil}, :network_type]}, :ipv6]}, {:==, [line: 384, column: 45], [{{:., [line: 384, column: 16], [{:__aliases__, [line: 384, column: 13], [:Map]}, :get]}, [line: 384, column: 17], [{:props, [line: 384, column: 21], nil}, :protocol_level]}, :bacnet_application]}]}]}]}` | | bacnet_ipv6_multicast_address | | | | Type | `decoder: {:&, [line: 409, column: 18], [{:decode_ipv6_address, [line: 409, column: 19], [:bacnet_ipv6_multicast_address, {:&, [line: 409, column: 71], [1]}]}]}, encoder: {:&, [line: 410, column: 18], [{:encode_ipv6_address, [line: 410, column: 19], [:bacnet_ipv6_multicast_address, {:&, [line: 410, column: 71], [1]}]}]}, required_when: {:fn, [line: 411, column: 24], [{:->, [line: 411, column: 42], [[{:props, [line: 411, column: 27], nil}, {:_object, [line: 411, column: 34], nil}], {:and, [line: 412, column: 50], [{:==, [line: 412, column: 41], [{{:., [line: 412, column: 14], [{:__aliases__, [line: 412, column: 11], [:Map]}, :get]}, [line: 412, column: 15], [{:props, [line: 412, ...], ...}, ...]}, ...]}, ...]}]}]}` | | bacnet_ipv6_udp_port | | | | Type | `required_when: {:fn, [line: 391, column: 24], [{:->, [line: 391, column: 42], [[{:props, [line: 391, column: 27], nil}, {:_object, [line: 391, column: 34], nil}], {:and, [line: 392, column: 50], [{:==, [line: 392, column: 41], [{{:., [line: 392, column: 14], [{:__aliases__, [line: 392, column: 11], [:Map]}, :get]}, [line: 392, column: 15], [{:props, [line: 392, column: 19], nil}, :network_type]}, :ipv6]}, {:==, [line: 393, column: 45], [{{:., [line: 393, column: 16], [{:__aliases__, [line: 393, column: 13], [:Map]}, :get]}, [line: 393, column: 17], [{:props, [line: 393, column: 21], nil}, :protocol_level]}, :bacnet_application]}]}]}]}` | | bbmd_accept_fd_registrations | | | bbmd_broadcast_distribution_table | | | | bbmd_broadcast_distribution_table | | | | | `required_when: {:fn, [line: 352, column: 24], [{:->, [line: 352, column: 42], [[{:props, [line: 352, column: 27], nil}, {:_object, [line: 352, column: 34], nil}], {:==, [line: 353, column: 43], [{{:., [line: 353, column: 14], [{:__aliases__, [line: 353, column: 11], [:Map]}, :get]}, [line: 353, column: 15], [{:props, [line: 353, column: 19], nil}, :bacnet_ip_mode]}, :bbmd]}]}]}` | | bbmd_foreign_device_table | | | bbmd_broadcast_distribution_table | | | | command | X | | | | `required_when: {:opt, :supports_command_execution}` | | event_algorithm_inhibit_ref | | | event_algorithm_inhibit | | | | fd_bbmd_address | | | | | `required_when: {:fn, [line: 369, column: 24], [{:->, [line: 369, column: 42], [[{:props, [line: 369, column: 27], nil}, {:_object, [line: 369, column: 34], nil}], {:==, [line: 370, column: 43], [{{:., [line: 370, column: 14], [{:__aliases__, [line: 370, column: 11], [:Map]}, :get]}, [line: 370, column: 15], [{:props, [line: 370, column: 19], nil}, :bacnet_ip_mode]}, :foreign]}]}]}` | | fd_subscription_lifetime | | | fd_bbmd_address | Type | | | ip_address | | | | | `decoder: {:&, [line: 269, column: 18], [{:decode_ipv4_address, [line: 269, column: 19], [:ip_address, {:&, [line: 269, column: 52], [1]}]}]}, encoder: {:&, [line: 270, column: 18], [{:encode_ipv4_address, [line: 270, column: 19], [:ip_address, {:&, [line: 270, column: 52], [1]}]}]}, required_when: {:fn, [line: 271, column: 24], [{:->, [line: 271, column: 42], [[{:props, [line: 271, column: 27], nil}, {:_object, [line: 271, column: 34], nil}], {:==, [line: 272, column: 41], [{{:., [line: 272, column: 14], [{:__aliases__, [line: 272, column: 11], [:Map]}, :get]}, [line: 272, column: 15], [{:props, [line: 272, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | ip_default_gateway | | | | | `decoder: {:&, [line: 289, column: 18], [{:decode_ipv4_address, [line: 289, column: 19], [:ip_default_gateway, {:&, [line: 289, column: 60], [1]}]}]}, encoder: {:&, [line: 290, column: 18], [{:encode_ipv4_address, [line: 290, column: 19], [:ip_default_gateway, {:&, [line: 290, column: 60], [1]}]}]}, required_when: {:fn, [line: 291, column: 24], [{:->, [line: 291, column: 42], [[{:props, [line: 291, column: 27], nil}, {:_object, [line: 291, column: 34], nil}], {:==, [line: 292, column: 41], [{{:., [line: 292, column: 14], [{:__aliases__, [line: 292, column: 11], [:Map]}, :get]}, [line: 292, column: 15], [{:props, [line: 292, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | ip_dhcp_enable | | | | | `required_when: {:fn, [line: 318, column: 24], [{:->, [line: 318, column: 42], [[{:props, [line: 318, column: 27], nil}, {:_object, [line: 318, column: 34], nil}], {:==, [line: 319, column: 41], [{{:., [line: 319, column: 14], [{:__aliases__, [line: 319, column: 11], [:Map]}, :get]}, [line: 319, column: 15], [{:props, [line: 319, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | ip_dhcp_server | | | | | `decoder: {:&, [line: 327, column: 18], [{:decode_ipv4_address, [line: 327, column: 19], [:ip_dhcp_server, {:&, [line: 327, column: 56], [1]}]}]}, encoder: {:&, [line: 328, column: 18], [{:encode_ipv4_address, [line: 328, column: 19], [:ip_dhcp_server, {:&, [line: 328, column: 56], [1]}]}]}` | | ip_dns_server | | | | | `decoder: {:&, [line: 308, column: 18], [{:decode_ipv4_address, [line: 308, column: 19], [:ip_dns_server, {:&, [line: 308, column: 55], [1]}]}]}, encoder: {:&, [line: 309, column: 18], [{:encode_ipv4_address, [line: 309, column: 19], [:ip_dns_server, {:&, [line: 309, column: 55], [1]}]}]}, required_when: {:fn, [line: 310, column: 24], [{:->, [line: 310, column: 42], [[{:props, [line: 310, column: 27], nil}, {:_object, [line: 310, column: 34], nil}], {:==, [line: 311, column: 41], [{{:., [line: 311, column: 14], [{:__aliases__, [line: 311, column: 11], [:Map]}, :get]}, [line: 311, column: 15], [{:props, [line: 311, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | ip_subnet_mask | | | | | `decoder: {:&, [line: 279, column: 18], [{:decode_ipv4_address, [line: 279, column: 19], [:ip_subnet_mask, {:&, [line: 279, column: 56], [1]}]}]}, encoder: {:&, [line: 280, column: 18], [{:encode_ipv4_address, [line: 280, column: 19], [:ip_subnet_mask, {:&, [line: 280, column: 56], [1]}]}]}, required_when: {:fn, [line: 281, column: 24], [{:->, [line: 281, column: 42], [[{:props, [line: 281, column: 27], nil}, {:_object, [line: 281, column: 34], nil}], {:==, [line: 282, column: 41], [{{:., [line: 282, column: 14], [{:__aliases__, [line: 282, column: 11], [:Map]}, :get]}, [line: 282, column: 15], [{:props, [line: 282, column: 19], nil}, :network_type]}, :ipv4]}]}]}` | | ipv6_address | | | | | `decoder: {:&, [line: 420, column: 18], [{:decode_ipv6_address, [line: 420, column: 19], [:ipv6_address, {:&, [line: 420, column: 54], [1]}]}]}, encoder: {:&, [line: 421, column: 18], [{:encode_ipv6_address, [line: 421, column: 19], [:ipv6_address, {:&, [line: 421, column: 54], [1]}]}]}, required_when: {:fn, [line: 422, column: 24], [{:->, [line: 422, column: 42], [[{:props, [line: 422, column: 27], nil}, {:_object, [line: 422, column: 34], nil}], {:==, [line: 423, column: 41], [{{:., [line: 423, column: 14], [{:__aliases__, [line: 423, column: 11], [:Map]}, :get]}, [line: 423, column: 15], [{:props, [line: 423, column: 19], nil}, :network_type]}, :ipv6]}]}]}` | | ipv6_default_gateway | | | | | `decoder: {:&, [line: 438, column: 18], [{:decode_ipv6_address, [line: 438, column: 19], [:ipv6_default_gateway, {:&, [line: 438, column: 62], [1]}]}]}, encoder: {:&, [line: 439, column: 18], [{:encode_ipv6_address, [line: 439, column: 19], [:ipv6_default_gateway, {:&, [line: 439, column: 62], [1]}]}]}, required_when: {:fn, [line: 440, column: 24], [{:->, [line: 440, column: 42], [[{:props, [line: 440, column: 27], nil}, {:_object, [line: 440, column: 34], nil}], {:==, [line: 441, column: 41], [{{:., [line: 441, column: 14], [{:__aliases__, [line: 441, column: 11], [:Map]}, :get]}, [line: 441, column: 15], [{:props, [line: 441, column: 19], nil}, :network_type]}, :ipv6]}]}]}` | | ipv6_dhcp_server | | | | | `decoder: {:&, [line: 470, column: 18], [{:decode_ipv6_address, [line: 470, column: 19], [:ipv6_dhcp_server, {:&, [line: 470, column: 58], [1]}]}]}, encoder: {:&, [line: 471, column: 18], [{:encode_ipv6_address, [line: 471, column: 19], [:ipv6_dhcp_server, {:&, [line: 471, column: 58], [1]}]}]}` | | ipv6_dns_server | X | | | | `decoder: {:&, [line: 449, column: 18], [{:decode_ipv6_address, [line: 449, column: 19], [:ipv6_dns_server, {:&, [line: 449, column: 57], [1]}]}]}, encoder: {:&, [line: 450, column: 18], [{:encode_ipv6_address, [line: 450, column: 19], [:ipv6_dns_server, {:&, [line: 450, column: 57], [1]}]}]}, required_when: {:fn, [line: 451, column: 24], [{:->, [line: 451, column: 42], [[{:props, [line: 451, column: 27], nil}, {:_object, [line: 451, column: 34], nil}], {:==, [line: 452, column: 41], [{{:., [line: 452, column: 14], [{:__aliases__, [line: 452, column: 11], [:Map]}, :get]}, [line: 452, column: 15], [{:props, [line: 452, column: 19], nil}, :network_type]}, :ipv6]}]}]}` | | ipv6_prefix_length | | | | | `required_when: {:fn, [line: 430, column: 24], [{:->, [line: 430, column: 42], [[{:props, [line: 430, column: 27], nil}, {:_object, [line: 430, column: 34], nil}], {:==, [line: 431, column: 41], [{{:., [line: 431, column: 14], [{:__aliases__, [line: 431, column: 11], [:Map]}, :get]}, [line: 431, column: 15], [{:props, [line: 431, column: 19], nil}, :network_type]}, :ipv6]}]}]}` | | link_speed | X | | | | `required_when: {:fn, [line: 230, column: 24], [{:->, [line: 230, column: 42], [[{:props, [line: 230, column: 27], nil}, {:_object, [line: 230, column: 34], nil}], {:and, [line: 238, column: 13], [{:in, [line: 231, column: 41], [{{:., [line: 231, column: 14], [{:__aliases__, [line: 231, column: 11], [:Map]}, :get]}, [line: 231, column: 15], [{:props, [line: 231, column: 19], nil}, :network_type]}, [:arcnet, :ethernet, :lontalk, :serial, :virtual, :zigbee]]}, {:==, [line: 239, column: 45], [{{:., [line: 239, column: 16], [{:__aliases__, [line: 239, column: 13], [:Map]}, :get]}, [line: 239, column: 17], [{:props, [line: 239, column: 21], ...}, ...]}, ...]}]}]}]}` | | link_speeds | X | | | | | | mac_address | | | | | `only_when: {:fn, [line: 196, column: 20], [{:->, [line: 196, column: 36], [[{:props, [line: 196, column: 23], nil}, {:_meta, [line: 196, column: 30], nil}], {:if, [line: 197, column: 11], [{:==, [line: 197, column: 35], [{{:., [from_brackets: true, line: 197, column: 19], [Access, :get]}, [from_brackets: true, line: 197, column: 19], [{:props, [line: 197, column: 14], nil}, :network_type]}, :ptp]}, [do: false, else: :optional]]}]}]}, required_when: {:fn, [line: 203, column: 24], [{:->, [line: 203, column: 42], [[{:props, [line: 203, column: 27], nil}, {:_object, [line: 203, column: 34], nil}], {:in, [line: 204, column: 41], [{{:., [line: 204, column: 14], ...}, ...}, ...]}]}]}` | | max_info_frames | | | | Type | | | max_master | | | max_info_frames | Type | | | network_number | X | | | Type | `required_when: {:fn, [line: 171, column: 24], [{:->, [line: 171, column: 40], [[{:props, [line: 171, column: 27], nil}, {:_meta, [line: 171, column: 34], nil}], {:in, [line: 172, column: 43], [{{:., [line: 172, column: 14], [{:__aliases__, [line: 172, column: 11], [:Map]}, :get]}, [line: 172, column: 15], [{:props, [line: 172, column: 19], nil}, :protocol_level]}, [:bacnet_application, :non_bacnet_application]]}]}]}` | | network_number_quality | X | | | | `required_when: {:fn, [line: 181, column: 24], [{:->, [line: 181, column: 40], [[{:props, [line: 181, column: 27], nil}, {:_meta, [line: 181, column: 34], nil}], {:in, [line: 182, column: 43], [{{:., [line: 182, column: 14], [{:__aliases__, [line: 182, column: 11], [:Map]}, :get]}, [line: 182, column: 15], [{:props, [line: 182, column: 19], nil}, :protocol_level]}, [:bacnet_application, :non_bacnet_application]]}]}]}` | | profile_location | | | | Fun | `revision: 19` | | protocol_level | | | | Fun | | | reliability | | | reliability_evaluation_inhibit | | | | tags | | | | | `revision: 19` | | virtual_mac_address_table | | | | | `required_when: {:fn, [line: 531, column: 24], [{:->, [line: 531, column: 42], [[{:props, [line: 531, column: 27], nil}, {:_object, [line: 531, column: 34], nil}], {:in, [line: 532, column: 41], [{{:., [line: 532, column: 14], [{:__aliases__, [line: 532, column: 11], [:Map]}, :get]}, [line: 532, column: 15], [{:props, [line: 532, column: 19], nil}, :network_type]}, [:ipv6, :sc, :zigbee]]}]}]}` | The following table shows the default values and/or init functions: | Property | Default Value | Init Function | |----------|---------------|---------------| | apdu_length | `1476` | | | command | `:idle` | | | ipv6_dns_server | `%BACnet.Protocol.BACnetArray{...}` | | | link_speed | `0.0` | | | link_speeds | `%BACnet.Protocol.BACnetArray{...}` | | | network_number | `0` | | | network_number_quality | `:unknown` | |

Summary

Types

Common object options for creation - all are optional.

Options accepted when creating or configuring a Network Port object.

Available property names for this object.

The structure for property errors.

t()

Represents a Network Port object. All keys should be treated as read-only; all updates should go only through update_property/3.

Functions

Adds an optional property to an object. Remote objects can not be mutated using this operation.

Creates a new object struct with the defined properties. Optional properties are not created when not given, only required, given and dependency properties are created. Properties with a value of nil are ignored.

Auto generated function to get the names of all properties this object supports.

Auto generated function to get the annotations for the given property name.

Auto generated function to get the list of annotations for each property.

Auto generated function to get the names of properties used for COV reporting.

Auto generated function to get the names of intrinsic properties.

Get the BACnet object identifier.

Auto generated function to get the names of optional properties.

Get the list of properties the object has.

Auto generated function to get a map of property name to type.

Get a property's value from an object.

Auto generated function to get the names of protected properties.

Auto generated function to get the names of readonly properties.

Auto generated function to get the names of required properties.

Checks if the given object has the given property.

Checks if the given object has Intrinsic Reporting enabled.

Checks if the given property is writable.

Removes an optional property from an object. This function is idempotent. Remote objects can not be mutated using this operation.

Auto generated function to check whether the object type supports intrinsic reporting.

Updates a property of an object.

Types

common_object_opts()

@type common_object_opts() ::
  {:allow_numeric_constants, boolean()}
  | {:allow_unknown_properties, boolean()}
  | {:ignore_unknown_properties, boolean()}
  | {:revision, BACnet.Protocol.Constants.protocol_revision()}
  | {:skip_property_validation_remote_object, boolean() | :value}

Common object options for creation - all are optional.

  • allow_numeric_constants - Constants are atoms and thus unknown constants or vendor extensions are integers and thus are rejected. Enabling this option will allow integers (non_neg_integer()) for properties with a Constants.type() spec.
  • allow_unknown_properties - Properties that are unknown to the object implementation are usually rejected. With this option, unknown properties (numeric identifiers usually means we dont know them) are accepted and put into a separate map. This does mean we can not validate or write them. Types of the values can be anything at this point. While you can read unknown properties with atom or integer as property identifier, you can only remove numeric unknown property identifiers from an object. Property identifiers of type atom are only accepted, if it is a remote object (object implementation is only enforced if it is a local object). Numeric property identifiers are accepted regardless of remote object or not. For remote objects, this means you have to write "raw values" (usually Encoding structs).
  • ignore_unknown_properties - Properties that are unknown to the object implementation are usually rejected. With this option, unknown properties get ignored, as if they were not specified.
  • revision - The BACnet protocol revision to check required properties against. Optional properties are regardless of revision available. See BACnet.Protocol.Constants.protocol_revision/0 for the available revisions.
  • skip_property_validation_remote_object - Skips property validation for remote objects. Sometimes it is possible that the value is invalid as per BACnet specification (i.e. value 0 for a multistate object), but you still want those to be represented. Value true neither type nor value are validated. Value :value means the type is still validated and only the value validator is not run (if present). The property's validator_fun will also be skipped.

object_opts()

@type object_opts() ::
  {:intrinsic_reporting, boolean()}
  | {:supports_command_execution, boolean()}
  | common_object_opts()

Options accepted when creating or configuring a Network Port object.

Supports enabling intrinsic reporting via intrinsic_reporting.

In addition to the common options, Network Port supports:

  • supports_command_execution - Enables command execution properties.

property_name()

@type property_name() ::
  :acked_transitions
  | :apdu_length
  | :auto_slave_discovery
  | :bacnet_ip_global_address
  | :bacnet_ip_mode
  | :bacnet_ip_multicast_address
  | :bacnet_ip_nat_traversal
  | :bacnet_ip_udp_port
  | :bacnet_ipv6_mode
  | :bacnet_ipv6_multicast_address
  | :bacnet_ipv6_udp_port
  | :bbmd_accept_fd_registrations
  | :bbmd_broadcast_distribution_table
  | :bbmd_foreign_device_table
  | :changes_pending
  | :command
  | :description
  | :event_algorithm_inhibit
  | :event_algorithm_inhibit_ref
  | :event_detection_enable
  | :event_enable
  | :event_message_texts
  | :event_message_texts_config
  | :event_timestamps
  | :fd_bbmd_address
  | :fd_subscription_lifetime
  | :ip_address
  | :ip_default_gateway
  | :ip_dhcp_enable
  | :ip_dhcp_lease_time
  | :ip_dhcp_lease_time_remaining
  | :ip_dhcp_server
  | :ip_dns_server
  | :ip_subnet_mask
  | :ipv6_address
  | :ipv6_auto_addressing_enable
  | :ipv6_default_gateway
  | :ipv6_dhcp_lease_time
  | :ipv6_dhcp_lease_time_remaining
  | :ipv6_dhcp_server
  | :ipv6_dns_server
  | :ipv6_prefix_length
  | :ipv6_zone_index
  | :limit_enable
  | :link_speed
  | :link_speed_autonegotiate
  | :link_speeds
  | :mac_address
  | :manual_slave_address_binding
  | :max_info_frames
  | :max_master
  | :network_interface_name
  | :network_number
  | :network_number_quality
  | :network_type
  | :notification_class
  | :notify_type
  | :object_instance
  | :object_name
  | :out_of_service
  | :profile_location
  | :profile_name
  | :protocol_level
  | :reference_port
  | :reliability
  | :reliability_evaluation_inhibit
  | :routing_table
  | :slave_address_binding
  | :slave_proxy_enable
  | :status_flags
  | :tags
  | :time_delay
  | :time_delay_normal
  | :virtual_mac_address_table

Available property names for this object.

property_update_error()

@type property_update_error() ::
  {:error,
   {error :: atom(),
    property :: BACnet.Protocol.Constants.property_identifier()}}

The structure for property errors.

t()

@type t() :: %BACnet.Protocol.ObjectTypes.NetworkPort{
  _metadata: internal_metadata(),
  _unknown_properties: %{
    optional(atom() | non_neg_integer()) =>
      term()
      | BACnet.Protocol.ApplicationTags.Encoding.t()
      | [BACnet.Protocol.ApplicationTags.Encoding.t()]
  },
  acked_transitions: BACnet.Protocol.EventTransitionBits.t() | nil,
  apdu_length: non_neg_integer() | nil,
  auto_slave_discovery: boolean() | nil,
  bacnet_ip_global_address: BACnet.Protocol.HostNPort.t() | nil,
  bacnet_ip_mode:
    BACnet.Protocol.Constants.ip_mode()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  bacnet_ip_multicast_address: :inet.ip4_address() | nil,
  bacnet_ip_nat_traversal: boolean() | nil,
  bacnet_ip_udp_port: BACnet.Protocol.ApplicationTags.unsigned16() | nil,
  bacnet_ipv6_mode:
    BACnet.Protocol.Constants.ip_mode()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  bacnet_ipv6_multicast_address:
    {:inet.ip6_address(), :inet.port_number()} | nil,
  bacnet_ipv6_udp_port: BACnet.Protocol.ApplicationTags.unsigned16() | nil,
  bbmd_accept_fd_registrations: boolean() | nil,
  bbmd_broadcast_distribution_table:
    [BACnet.Protocol.BroadcastDistributionTableEntry.t()] | nil,
  bbmd_foreign_device_table:
    [BACnet.Protocol.ForeignDeviceTableEntry.t()] | nil,
  changes_pending: boolean(),
  command:
    BACnet.Protocol.Constants.network_port_command()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  description: String.t() | nil,
  event_algorithm_inhibit: boolean() | nil,
  event_algorithm_inhibit_ref: BACnet.Protocol.ObjectPropertyRef.t() | nil,
  event_detection_enable: boolean() | nil,
  event_enable: BACnet.Protocol.EventTransitionBits.t() | nil,
  event_message_texts: BACnet.Protocol.EventMessageTexts.t() | nil,
  event_message_texts_config: BACnet.Protocol.EventMessageTexts.t() | nil,
  event_timestamps: BACnet.Protocol.EventTimestamps.t() | nil,
  fd_bbmd_address: BACnet.Protocol.HostNPort.t() | nil,
  fd_subscription_lifetime: BACnet.Protocol.ApplicationTags.unsigned16() | nil,
  ip_address: :inet.ip4_address() | nil,
  ip_default_gateway: :inet.ip4_address() | nil,
  ip_dhcp_enable: boolean() | nil,
  ip_dhcp_lease_time: non_neg_integer() | nil,
  ip_dhcp_lease_time_remaining: non_neg_integer() | nil,
  ip_dhcp_server: :inet.ip4_address() | nil,
  ip_dns_server: BACnet.Protocol.BACnetArray.t(:inet.ip4_address()) | nil,
  ip_subnet_mask: :inet.ip4_address() | nil,
  ipv6_address: :inet.ip6_address() | nil,
  ipv6_auto_addressing_enable: boolean() | nil,
  ipv6_default_gateway: :inet.ip6_address() | nil,
  ipv6_dhcp_lease_time: non_neg_integer() | nil,
  ipv6_dhcp_lease_time_remaining: non_neg_integer() | nil,
  ipv6_dhcp_server: :inet.ip6_address() | nil,
  ipv6_dns_server: BACnet.Protocol.BACnetArray.t(:inet.ip6_address()) | nil,
  ipv6_prefix_length: 0..128 | nil,
  ipv6_zone_index: String.t() | nil,
  limit_enable: BACnet.Protocol.LimitEnable.t() | nil,
  link_speed: float() | nil,
  link_speed_autonegotiate: boolean() | nil,
  link_speeds: BACnet.Protocol.BACnetArray.t(float()) | nil,
  mac_address: binary() | nil,
  manual_slave_address_binding: [BACnet.Protocol.AddressBinding.t()] | nil,
  max_info_frames: pos_integer() | nil,
  max_master: 1..127 | nil,
  network_interface_name: String.t() | nil,
  network_number: BACnet.Protocol.ApplicationTags.unsigned16() | nil,
  network_number_quality:
    BACnet.Protocol.Constants.network_number_quality()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  network_type:
    BACnet.Protocol.Constants.network_type()
    | (reserved_or_vendor_extension :: non_neg_integer()),
  notification_class: non_neg_integer() | nil,
  notify_type:
    BACnet.Protocol.Constants.notify_type()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  object_instance: non_neg_integer(),
  object_name: String.t(),
  out_of_service: boolean() | nil,
  profile_location: String.t() | nil,
  profile_name: String.t() | nil,
  protocol_level:
    BACnet.Protocol.Constants.protocol_level()
    | (reserved_or_vendor_extension :: non_neg_integer()),
  reference_port: non_neg_integer() | nil,
  reliability:
    BACnet.Protocol.Constants.reliability()
    | (reserved_or_vendor_extension :: non_neg_integer())
    | nil,
  reliability_evaluation_inhibit: boolean() | nil,
  routing_table: [BACnet.Protocol.RouterEntry.t()] | nil,
  slave_address_binding: [BACnet.Protocol.AddressBinding.t()] | nil,
  slave_proxy_enable: boolean() | nil,
  status_flags: BACnet.Protocol.StatusFlags.t(),
  tags: BACnet.Protocol.BACnetArray.t(BACnet.Protocol.NameValue.t()) | nil,
  time_delay: non_neg_integer() | nil,
  time_delay_normal: non_neg_integer() | nil,
  virtual_mac_address_table: [BACnet.Protocol.VmacEntry.t()] | nil
}

Represents a Network Port object. All keys should be treated as read-only; all updates should go only through update_property/3.

Properties which are for Intrinsic Reporting are nil if disabled. If Intrinsic Reporting is enabled on the object, then the properties can not be nil. Many properties are conditional on network_type and protocol_level.

Functions

add_property(object, property, value)

@spec add_property(t(), BACnet.Protocol.Constants.property_identifier(), term()) ::
  {:ok, t()} | property_update_error()

Adds an optional property to an object. Remote objects can not be mutated using this operation.

Please note that properties of services can not be dynamically added and instead the object must be newly created using create/4.

create(instance_number, object_name, properties \\ %{}, opts \\ [])

@spec create(
  non_neg_integer(),
  String.t(),
  %{optional(property_name() | atom() | non_neg_integer()) => term()},
  [object_opts() | internal_metadata()]
) :: {:ok, t()} | property_update_error()

Creates a new object struct with the defined properties. Optional properties are not created when not given, only required, given and dependency properties are created. Properties with a value of nil are ignored.

Only properties that are required for specific services (i.e. Intrinsic Reporting) are automatically created.

get_all_properties()

@spec get_all_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of all properties this object supports.

get_annotation(name)

@spec get_annotation(property_name()) :: [term()]

Auto generated function to get the annotations for the given property name.

get_annotations()

@spec get_annotations() :: [{name :: property_name(), values :: [term()]}]

Auto generated function to get the list of annotations for each property.

get_cov_properties()

@spec get_cov_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of properties used for COV reporting.

get_intrinsic_properties()

@spec get_intrinsic_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of intrinsic properties.

get_object_identifier(object)

@spec get_object_identifier(t()) :: BACnet.Protocol.ObjectIdentifier.t()

Get the BACnet object identifier.

get_optional_properties()

@spec get_optional_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of optional properties.

get_properties(object)

@spec get_properties(t()) :: [BACnet.Protocol.Constants.property_identifier()]

Get the list of properties the object has.

get_properties_type_map()

@spec get_properties_type_map() :: map()

Auto generated function to get a map of property name to type.

get_property(object, property)

Get a property's value from an object.

get_protected_properties()

@spec get_protected_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of protected properties.

Protected is an annotation and the object modules prevent writing to this property directly in code. The protected properties are either written on creation or updated automatically depending on other properties being written to. Some properties are only written once at creation and never updated.

get_readonly_properties()

@spec get_readonly_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of readonly properties.

Readonly is only an annotation that the property should be write protected on the BACnet side, there is no actual write protection in the object. This is a hint to the device server. If you need actual write protection, see protected.

get_required_properties()

@spec get_required_properties() :: [BACnet.Protocol.Constants.property_identifier()]

Auto generated function to get the names of required properties.

has_property?(object, property)

Checks if the given object has the given property.

See BACnet.Protocol.ObjectsUtility.has_property?/2 for implementation details.

intrinsic_reporting?(object)

@spec intrinsic_reporting?(t()) :: boolean()

Checks if the given object has Intrinsic Reporting enabled.

property_writable?(object, property)

@spec property_writable?(t(), BACnet.Protocol.Constants.property_identifier()) ::
  boolean()

Checks if the given property is writable.

Check BACnet.Protocol.ObjectsUtility.property_writable?/2 for a basic run-down.

remove_property(object, property)

@spec remove_property(
  t(),
  BACnet.Protocol.Constants.property_identifier() | non_neg_integer()
) ::
  {:ok, t()} | property_update_error()

Removes an optional property from an object. This function is idempotent. Remote objects can not be mutated using this operation.

Please note that properties of services can not be dynamically removed and instead the object must be newly created using create/4. Required properties can not be removed.

supports_intrinsic()

@spec supports_intrinsic() :: boolean()

Auto generated function to check whether the object type supports intrinsic reporting.

update_property(object, property, value)

@spec update_property(t(), BACnet.Protocol.Constants.property_identifier(), term()) ::
  {:ok, t()} | property_update_error()
@spec update_property(t(), BACnet.Protocol.Constants.property_identifier(), term()) ::
  {:ok, t()} | property_update_error()

Updates a property of an object.