Packages

BACstack is a low-level Elixir implementation for the ASHRAE standard 135, BACnet - Building Automation and Controller network. In its current published state, v0.0.x, it can (only) act as a BACnet client for other BACnet devices.

Current section

Files

Jump to
bacstack lib bacnet protocol constants property_identifier.ex
Raw

lib/bacnet/protocol/constants/property_identifier.ex

defmodule BACnet.Protocol.Constants.PropertyIdentifier do
  @moduledoc false
  # Can be extended through env :bacstack, :additional_property_identifiers

  use ConstEnum, exception: BACnet.Protocol.Constants.ConstantError

  # The name usually matches the clause 21 definition and `-` translated to `_`,
  # with the expection of `maximum` and `minimum` short form and expanding `pres` to `present`.
  # And `event-time-stamps` has been changed to remove one hyphen.
  #
  # When new property identifiers are added that don't match with the clause 21,
  # with - translated to _, these need to be added to the `clause21_translation` map below.
  defconst(:property_identifier, :acked_transitions, 0x00)
  defconst(:property_identifier, :ack_required, 0x01)
  defconst(:property_identifier, :action, 0x02)
  defconst(:property_identifier, :action_text, 0x03)
  defconst(:property_identifier, :active_text, 0x04)
  defconst(:property_identifier, :active_vt_sessions, 0x05)
  defconst(:property_identifier, :alarm_value, 0x06)
  defconst(:property_identifier, :alarm_values, 0x07)
  defconst(:property_identifier, :all, 0x08)
  defconst(:property_identifier, :all_writes_successful, 0x09)
  defconst(:property_identifier, :apdu_segment_timeout, 0x0A)
  defconst(:property_identifier, :apdu_timeout, 0x0B)
  defconst(:property_identifier, :application_software_version, 0x0C)
  defconst(:property_identifier, :archive, 0x0D)
  defconst(:property_identifier, :bias, 0x0E)
  defconst(:property_identifier, :change_of_state_count, 0x0F)
  defconst(:property_identifier, :change_of_state_time, 0x10)
  defconst(:property_identifier, :notification_class, 0x11)
  defconst(:property_identifier, :controlled_variable_reference, 0x13)
  defconst(:property_identifier, :controlled_variable_units, 0x14)
  defconst(:property_identifier, :controlled_variable_value, 0x15)
  defconst(:property_identifier, :cov_increment, 0x16)
  defconst(:property_identifier, :date_list, 0x17)
  defconst(:property_identifier, :daylight_savings_status, 0x18)
  defconst(:property_identifier, :deadband, 0x19)
  defconst(:property_identifier, :derivative_constant, 0x1A)
  defconst(:property_identifier, :derivative_constant_units, 0x1B)
  defconst(:property_identifier, :description, 0x1C)
  defconst(:property_identifier, :description_of_halt, 0x1D)
  defconst(:property_identifier, :device_address_binding, 0x1E)
  defconst(:property_identifier, :device_type, 0x1F)
  defconst(:property_identifier, :effective_period, 0x20)
  defconst(:property_identifier, :elapsed_active_time, 0x21)
  defconst(:property_identifier, :error_limit, 0x22)
  defconst(:property_identifier, :event_enable, 0x23)
  defconst(:property_identifier, :event_state, 0x24)
  defconst(:property_identifier, :event_type, 0x25)
  defconst(:property_identifier, :exception_schedule, 0x26)
  defconst(:property_identifier, :fault_values, 0x27)
  defconst(:property_identifier, :feedback_value, 0x28)
  defconst(:property_identifier, :file_access_method, 0x29)
  defconst(:property_identifier, :file_size, 0x2A)
  defconst(:property_identifier, :file_type, 0x2B)
  defconst(:property_identifier, :firmware_revision, 0x2C)
  defconst(:property_identifier, :high_limit, 0x2D)
  defconst(:property_identifier, :inactive_text, 0x2E)
  defconst(:property_identifier, :in_process, 0x2F)
  defconst(:property_identifier, :instance_of, 0x30)
  defconst(:property_identifier, :integral_constant, 0x31)
  defconst(:property_identifier, :integral_constant_units, 0x32)
  defconst(:property_identifier, :limit_enable, 0x34)
  defconst(:property_identifier, :list_of_group_members, 0x35)
  defconst(:property_identifier, :list_of_object_property_references, 0x36)
  defconst(:property_identifier, :local_date, 0x38)
  defconst(:property_identifier, :local_time, 0x39)
  defconst(:property_identifier, :location, 0x3A)
  defconst(:property_identifier, :low_limit, 0x3B)
  defconst(:property_identifier, :manipulated_variable_reference, 0x3C)
  defconst(:property_identifier, :max_output, 0x3D)
  defconst(:property_identifier, :max_apdu_length_accepted, 0x3E)
  defconst(:property_identifier, :max_info_frames, 0x3F)
  defconst(:property_identifier, :max_master, 0x40)
  defconst(:property_identifier, :max_present_value, 0x41)
  defconst(:property_identifier, :min_off_time, 0x42)
  defconst(:property_identifier, :min_on_time, 0x43)
  defconst(:property_identifier, :min_output, 0x44)
  defconst(:property_identifier, :min_present_value, 0x45)
  defconst(:property_identifier, :model_name, 0x46)
  defconst(:property_identifier, :modification_date, 0x47)
  defconst(:property_identifier, :notify_type, 0x48)
  defconst(:property_identifier, :number_of_apdu_retries, 0x49)
  defconst(:property_identifier, :number_of_states, 0x4A)
  defconst(:property_identifier, :object_identifier, 0x4B)
  defconst(:property_identifier, :object_list, 0x4C)
  defconst(:property_identifier, :object_name, 0x4D)
  defconst(:property_identifier, :object_property_reference, 0x4E)
  defconst(:property_identifier, :object_type, 0x4F)
  defconst(:property_identifier, :optional, 0x50)
  defconst(:property_identifier, :out_of_service, 0x51)
  defconst(:property_identifier, :output_units, 0x52)
  defconst(:property_identifier, :event_parameters, 0x53)
  defconst(:property_identifier, :polarity, 0x54)
  defconst(:property_identifier, :present_value, 0x55)
  defconst(:property_identifier, :priority, 0x56)
  defconst(:property_identifier, :priority_array, 0x57)
  defconst(:property_identifier, :priority_for_writing, 0x58)
  defconst(:property_identifier, :process_identifier, 0x59)
  defconst(:property_identifier, :program_change, 0x5A)
  defconst(:property_identifier, :program_location, 0x5B)
  defconst(:property_identifier, :program_state, 0x5C)
  defconst(:property_identifier, :proportional_constant, 0x5D)
  defconst(:property_identifier, :proportional_constant_units, 0x5E)
  defconst(:property_identifier, :protocol_object_types_supported, 0x60)
  defconst(:property_identifier, :protocol_services_supported, 0x61)
  defconst(:property_identifier, :protocol_version, 0x62)
  defconst(:property_identifier, :read_only, 0x63)
  defconst(:property_identifier, :reason_for_halt, 0x64)
  defconst(:property_identifier, :recipient_list, 0x66)
  defconst(:property_identifier, :reliability, 0x67)
  defconst(:property_identifier, :relinquish_default, 0x68)
  defconst(:property_identifier, :required, 0x69)
  defconst(:property_identifier, :resolution, 0x6A)
  defconst(:property_identifier, :segmentation_supported, 0x6B)
  defconst(:property_identifier, :setpoint, 0x6C)
  defconst(:property_identifier, :setpoint_reference, 0x6D)
  defconst(:property_identifier, :state_text, 0x6E)
  defconst(:property_identifier, :status_flags, 0x6F)
  defconst(:property_identifier, :system_status, 0x70)
  defconst(:property_identifier, :time_delay, 0x71)
  defconst(:property_identifier, :time_of_active_time_reset, 0x72)
  defconst(:property_identifier, :time_of_state_count_reset, 0x73)
  defconst(:property_identifier, :time_synchronization_recipients, 0x74)
  defconst(:property_identifier, :units, 0x75)
  defconst(:property_identifier, :update_interval, 0x76)
  defconst(:property_identifier, :utc_offset, 0x77)
  defconst(:property_identifier, :vendor_identifier, 0x78)
  defconst(:property_identifier, :vendor_name, 0x79)
  defconst(:property_identifier, :vt_classes_supported, 0x7A)
  defconst(:property_identifier, :weekly_schedule, 0x7B)
  defconst(:property_identifier, :attempted_samples, 0x7C)
  defconst(:property_identifier, :average_value, 0x7D)
  defconst(:property_identifier, :buffer_size, 0x7E)
  defconst(:property_identifier, :client_cov_increment, 0x7F)
  defconst(:property_identifier, :cov_resubscription_interval, 0x80)
  defconst(:property_identifier, :event_timestamps, 0x82)
  defconst(:property_identifier, :log_buffer, 0x83)
  defconst(:property_identifier, :log_device_object_property, 0x84)
  defconst(:property_identifier, :enable, 0x85)
  defconst(:property_identifier, :log_interval, 0x86)
  defconst(:property_identifier, :max_value, 0x87)
  defconst(:property_identifier, :min_value, 0x88)
  defconst(:property_identifier, :notification_threshold, 0x89)
  defconst(:property_identifier, :protocol_revision, 0x8B)
  defconst(:property_identifier, :records_since_notification, 0x8C)
  defconst(:property_identifier, :record_count, 0x8D)
  defconst(:property_identifier, :start_time, 0x8E)
  defconst(:property_identifier, :stop_time, 0x8F)
  defconst(:property_identifier, :stop_when_full, 0x90)
  defconst(:property_identifier, :total_record_count, 0x91)
  defconst(:property_identifier, :valid_samples, 0x92)
  defconst(:property_identifier, :window_interval, 0x93)
  defconst(:property_identifier, :window_samples, 0x94)
  defconst(:property_identifier, :max_value_timestamp, 0x95)
  defconst(:property_identifier, :min_value_timestamp, 0x96)
  defconst(:property_identifier, :variance_value, 0x97)
  defconst(:property_identifier, :active_cov_subscriptions, 0x98)
  defconst(:property_identifier, :backup_failure_timeout, 0x99)
  defconst(:property_identifier, :configuration_files, 0x9A)
  defconst(:property_identifier, :database_revision, 0x9B)
  defconst(:property_identifier, :direct_reading, 0x9C)
  defconst(:property_identifier, :last_restore_time, 0x9D)
  defconst(:property_identifier, :maintenance_required, 0x9E)
  defconst(:property_identifier, :member_of, 0x9F)
  defconst(:property_identifier, :mode, 0xA0)
  defconst(:property_identifier, :operation_expected, 0xA1)
  defconst(:property_identifier, :setting, 0xA2)
  defconst(:property_identifier, :silenced, 0xA3)
  defconst(:property_identifier, :tracking_value, 0xA4)
  defconst(:property_identifier, :zone_members, 0xA5)
  defconst(:property_identifier, :life_safety_alarm_values, 0xA6)
  defconst(:property_identifier, :max_segments_accepted, 0xA7)
  defconst(:property_identifier, :profile_name, 0xA8)
  defconst(:property_identifier, :auto_slave_discovery, 0xA9)
  defconst(:property_identifier, :manual_slave_address_binding, 0xAA)
  defconst(:property_identifier, :slave_address_binding, 0xAB)
  defconst(:property_identifier, :slave_proxy_enable, 0xAC)
  defconst(:property_identifier, :last_notify_record, 0xAD)
  defconst(:property_identifier, :schedule_default, 0xAE)
  defconst(:property_identifier, :accepted_modes, 0xAF)
  defconst(:property_identifier, :adjust_value, 0xB0)
  defconst(:property_identifier, :count, 0xB1)
  defconst(:property_identifier, :count_before_change, 0xB2)
  defconst(:property_identifier, :count_change_time, 0xB3)
  defconst(:property_identifier, :cov_period, 0xB4)
  defconst(:property_identifier, :input_reference, 0xB5)
  defconst(:property_identifier, :limit_monitoring_interval, 0xB6)
  defconst(:property_identifier, :logging_object, 0xB7)
  defconst(:property_identifier, :logging_record, 0xB8)
  defconst(:property_identifier, :prescale, 0xB9)
  defconst(:property_identifier, :pulse_rate, 0xBA)
  defconst(:property_identifier, :scale, 0xBB)
  defconst(:property_identifier, :scale_factor, 0xBC)
  defconst(:property_identifier, :update_time, 0xBD)
  defconst(:property_identifier, :value_before_change, 0xBE)
  defconst(:property_identifier, :value_set, 0xBF)
  defconst(:property_identifier, :value_change_time, 0xC0)
  defconst(:property_identifier, :align_intervals, 0xC1)
  defconst(:property_identifier, :interval_offset, 0xC3)
  defconst(:property_identifier, :last_restart_reason, 0xC4)
  defconst(:property_identifier, :logging_type, 0xC5)
  defconst(:property_identifier, :restart_notification_recipients, 0xCA)
  defconst(:property_identifier, :time_of_device_restart, 0xCB)
  defconst(:property_identifier, :time_synchronization_interval, 0xCC)
  defconst(:property_identifier, :trigger, 0xCD)
  defconst(:property_identifier, :utc_time_synchronization_recipients, 0xCE)
  defconst(:property_identifier, :node_subtype, 0xCF)
  defconst(:property_identifier, :node_type, 0xD0)
  defconst(:property_identifier, :structured_object_list, 0xD1)
  defconst(:property_identifier, :subordinate_annotations, 0xD2)
  defconst(:property_identifier, :subordinate_list, 0xD3)
  defconst(:property_identifier, :actual_shed_level, 0xD4)
  defconst(:property_identifier, :duty_window, 0xD5)
  defconst(:property_identifier, :expected_shed_level, 0xD6)
  defconst(:property_identifier, :full_duty_baseline, 0xD7)
  defconst(:property_identifier, :requested_shed_level, 0xDA)
  defconst(:property_identifier, :shed_duration, 0xDB)
  defconst(:property_identifier, :shed_level_descriptions, 0xDC)
  defconst(:property_identifier, :shed_levels, 0xDD)
  defconst(:property_identifier, :state_description, 0xDE)
  defconst(:property_identifier, :door_alarm_state, 0xE2)
  defconst(:property_identifier, :door_extended_pulse_time, 0xE3)
  defconst(:property_identifier, :door_members, 0xE4)
  defconst(:property_identifier, :door_open_too_long_time, 0xE5)
  defconst(:property_identifier, :door_pulse_time, 0xE6)
  defconst(:property_identifier, :door_status, 0xE7)
  defconst(:property_identifier, :door_unlock_delay_time, 0xE8)
  defconst(:property_identifier, :lock_status, 0xE9)
  defconst(:property_identifier, :masked_alarm_values, 0xEA)
  defconst(:property_identifier, :secured_status, 0xEB)
  defconst(:property_identifier, :absentee_limit, 0xF4)
  defconst(:property_identifier, :access_alarm_events, 0xF5)
  defconst(:property_identifier, :access_doors, 0xF6)
  defconst(:property_identifier, :access_event, 0xF7)
  defconst(:property_identifier, :access_event_authentication_factor, 0xF8)
  defconst(:property_identifier, :access_event_credential, 0xF9)
  defconst(:property_identifier, :access_event_time, 0xFA)
  defconst(:property_identifier, :access_transaction_events, 0xFB)
  defconst(:property_identifier, :accompaniment, 0xFC)
  defconst(:property_identifier, :accompaniment_time, 0xFD)
  defconst(:property_identifier, :activation_time, 0xFE)
  defconst(:property_identifier, :active_authentication_policy, 0xFF)
  defconst(:property_identifier, :assigned_access_rights, 0x100)
  defconst(:property_identifier, :authentication_factors, 0x101)
  defconst(:property_identifier, :authentication_policy_list, 0x102)
  defconst(:property_identifier, :authentication_policy_names, 0x103)
  defconst(:property_identifier, :authentication_status, 0x104)
  defconst(:property_identifier, :authorization_mode, 0x105)
  defconst(:property_identifier, :belongs_to, 0x106)
  defconst(:property_identifier, :credential_disable, 0x107)
  defconst(:property_identifier, :credential_status, 0x108)
  defconst(:property_identifier, :credentials, 0x109)
  defconst(:property_identifier, :credentials_in_zone, 0x10A)
  defconst(:property_identifier, :days_remaining, 0x10B)
  defconst(:property_identifier, :entry_points, 0x10C)
  defconst(:property_identifier, :exit_points, 0x10D)
  defconst(:property_identifier, :expiration_time, 0x10E)
  defconst(:property_identifier, :extended_time_enable, 0x10F)
  defconst(:property_identifier, :failed_attempt_events, 0x110)
  defconst(:property_identifier, :failed_attempts, 0x111)
  defconst(:property_identifier, :failed_attempts_time, 0x112)
  defconst(:property_identifier, :last_access_event, 0x113)
  defconst(:property_identifier, :last_access_point, 0x114)
  defconst(:property_identifier, :last_credential_added, 0x115)
  defconst(:property_identifier, :last_credential_added_time, 0x116)
  defconst(:property_identifier, :last_credential_removed, 0x117)
  defconst(:property_identifier, :last_credential_removed_time, 0x118)
  defconst(:property_identifier, :last_use_time, 0x119)
  defconst(:property_identifier, :lockout, 0x11A)
  defconst(:property_identifier, :lockout_relinquish_time, 0x11B)
  defconst(:property_identifier, :max_failed_attempts, 0x11D)
  defconst(:property_identifier, :members, 0x11E)
  defconst(:property_identifier, :muster_point, 0x11F)
  defconst(:property_identifier, :negative_access_rules, 0x120)
  defconst(:property_identifier, :number_of_authentication_policies, 0x121)
  defconst(:property_identifier, :occupancy_count, 0x122)
  defconst(:property_identifier, :occupancy_count_adjust, 0x123)
  defconst(:property_identifier, :occupancy_count_enable, 0x124)
  defconst(:property_identifier, :occupancy_lower_limit, 0x126)
  defconst(:property_identifier, :occupancy_lower_limit_enforced, 0x127)
  defconst(:property_identifier, :occupancy_state, 0x128)
  defconst(:property_identifier, :occupancy_upper_limit, 0x129)
  defconst(:property_identifier, :occupancy_upper_limit_enforced, 0x12A)
  defconst(:property_identifier, :passback_mode, 0x12C)
  defconst(:property_identifier, :passback_timeout, 0x12D)
  defconst(:property_identifier, :positive_access_rules, 0x12E)
  defconst(:property_identifier, :reason_for_disable, 0x12F)
  defconst(:property_identifier, :supported_formats, 0x130)
  defconst(:property_identifier, :supported_format_classes, 0x131)
  defconst(:property_identifier, :threat_authority, 0x132)
  defconst(:property_identifier, :threat_level, 0x133)
  defconst(:property_identifier, :trace_flag, 0x134)
  defconst(:property_identifier, :transaction_notification_class, 0x135)
  defconst(:property_identifier, :user_external_identifier, 0x136)
  defconst(:property_identifier, :user_information_reference, 0x137)
  defconst(:property_identifier, :user_name, 0x13D)
  defconst(:property_identifier, :user_type, 0x13E)
  defconst(:property_identifier, :uses_remaining, 0x13F)
  defconst(:property_identifier, :zone_from, 0x140)
  defconst(:property_identifier, :zone_to, 0x141)
  defconst(:property_identifier, :access_event_tag, 0x142)
  defconst(:property_identifier, :global_identifier, 0x143)
  defconst(:property_identifier, :verification_time, 0x146)
  defconst(:property_identifier, :base_device_security_policy, 0x147)
  defconst(:property_identifier, :distribution_key_revision, 0x148)
  defconst(:property_identifier, :do_not_hide, 0x149)
  defconst(:property_identifier, :key_sets, 0x14A)
  defconst(:property_identifier, :last_key_server, 0x14B)
  defconst(:property_identifier, :network_access_security_policies, 0x14C)
  defconst(:property_identifier, :packet_reorder_time, 0x14D)
  defconst(:property_identifier, :security_pdu_timeout, 0x14E)
  defconst(:property_identifier, :security_time_window, 0x14F)
  defconst(:property_identifier, :supported_security_algorithms, 0x150)
  defconst(:property_identifier, :update_key_set_timeout, 0x151)
  defconst(:property_identifier, :backup_and_restore_state, 0x152)
  defconst(:property_identifier, :backup_preparation_time, 0x153)
  defconst(:property_identifier, :restore_completion_time, 0x154)
  defconst(:property_identifier, :restore_preparation_time, 0x155)
  defconst(:property_identifier, :bit_mask, 0x156)
  defconst(:property_identifier, :bit_text, 0x157)
  defconst(:property_identifier, :is_utc, 0x158)
  defconst(:property_identifier, :group_members, 0x159)
  defconst(:property_identifier, :group_member_names, 0x15A)
  defconst(:property_identifier, :member_status_flags, 0x15B)
  defconst(:property_identifier, :requested_update_interval, 0x15C)
  defconst(:property_identifier, :covu_period, 0x15D)
  defconst(:property_identifier, :covu_recipients, 0x15E)
  defconst(:property_identifier, :event_message_texts, 0x15F)
  defconst(:property_identifier, :event_message_texts_config, 0x160)
  defconst(:property_identifier, :event_detection_enable, 0x161)
  defconst(:property_identifier, :event_algorithm_inhibit, 0x162)
  defconst(:property_identifier, :event_algorithm_inhibit_ref, 0x163)
  defconst(:property_identifier, :time_delay_normal, 0x164)
  defconst(:property_identifier, :reliability_evaluation_inhibit, 0x165)
  defconst(:property_identifier, :fault_parameters, 0x166)
  defconst(:property_identifier, :fault_type, 0x167)
  defconst(:property_identifier, :local_forwarding_only, 0x168)
  defconst(:property_identifier, :process_identifier_filter, 0x169)
  defconst(:property_identifier, :subscribed_recipients, 0x16A)
  defconst(:property_identifier, :port_filter, 0x16B)
  defconst(:property_identifier, :authorization_exemptions, 0x16C)
  defconst(:property_identifier, :allow_group_delay_inhibit, 0x16D)
  defconst(:property_identifier, :channel_number, 0x16E)
  defconst(:property_identifier, :control_groups, 0x16F)
  defconst(:property_identifier, :execution_delay, 0x170)
  defconst(:property_identifier, :last_priority, 0x171)
  defconst(:property_identifier, :write_status, 0x172)
  defconst(:property_identifier, :property_list, 0x173)
  defconst(:property_identifier, :serial_number, 0x174)
  defconst(:property_identifier, :blink_warn_enable, 0x175)
  defconst(:property_identifier, :default_fade_time, 0x176)
  defconst(:property_identifier, :default_ramp_rate, 0x177)
  defconst(:property_identifier, :default_step_increment, 0x178)
  defconst(:property_identifier, :egress_time, 0x179)
  defconst(:property_identifier, :in_progress, 0x17A)
  defconst(:property_identifier, :instantaneous_power, 0x17B)
  defconst(:property_identifier, :lighting_command, 0x17C)
  defconst(:property_identifier, :lighting_command_default_priority, 0x17D)
  defconst(:property_identifier, :max_actual_value, 0x17E)
  defconst(:property_identifier, :min_actual_value, 0x17F)
  defconst(:property_identifier, :power, 0x180)
  defconst(:property_identifier, :transition, 0x181)
  defconst(:property_identifier, :egress_active, 0x182)
  defconst(:property_identifier, :interface_value, 0x183)
  defconst(:property_identifier, :fault_high_limit, 0x184)
  defconst(:property_identifier, :fault_low_limit, 0x185)
  defconst(:property_identifier, :low_diff_limit, 0x186)
  defconst(:property_identifier, :strike_count, 0x187)
  defconst(:property_identifier, :time_of_strike_count_reset, 0x188)
  defconst(:property_identifier, :default_timeout, 0x189)
  defconst(:property_identifier, :initial_timeout, 0x18A)
  defconst(:property_identifier, :last_state_change, 0x18B)
  defconst(:property_identifier, :state_change_values, 0x18C)
  defconst(:property_identifier, :timer_running, 0x18D)
  defconst(:property_identifier, :timer_state, 0x18E)
  defconst(:property_identifier, :apdu_length, 0x18F)
  defconst(:property_identifier, :ip_address, 0x190)
  defconst(:property_identifier, :ip_default_gateway, 0x191)
  defconst(:property_identifier, :ip_dhcp_enable, 0x192)
  defconst(:property_identifier, :ip_dhcp_lease_time, 0x193)
  defconst(:property_identifier, :ip_dhcp_lease_time_remaining, 0x194)
  defconst(:property_identifier, :ip_dhcp_server, 0x195)
  defconst(:property_identifier, :ip_dns_server, 0x196)
  defconst(:property_identifier, :bacnet_ip_global_address, 0x197)
  defconst(:property_identifier, :bacnet_ip_mode, 0x198)
  defconst(:property_identifier, :bacnet_ip_multicast_address, 0x199)
  defconst(:property_identifier, :bacnet_ip_nat_traversal, 0x19A)
  defconst(:property_identifier, :ip_subnet_mask, 0x19B)
  defconst(:property_identifier, :bacnet_ip_udp_port, 0x19C)
  defconst(:property_identifier, :bbmd_accept_fd_registrations, 0x19D)
  defconst(:property_identifier, :bbmd_broadcast_distribution_table, 0x19E)
  defconst(:property_identifier, :bbmd_foreign_device_table, 0x19F)
  defconst(:property_identifier, :changes_pending, 0x1A0)
  defconst(:property_identifier, :command, 0x1A1)
  defconst(:property_identifier, :fd_bbmd_address, 0x1A2)
  defconst(:property_identifier, :fd_subscription_lifetime, 0x1A3)
  defconst(:property_identifier, :link_speed, 0x1A4)
  defconst(:property_identifier, :link_speeds, 0x1A5)
  defconst(:property_identifier, :link_speed_autonegotiate, 0x1A6)
  defconst(:property_identifier, :mac_address, 0x1A7)
  defconst(:property_identifier, :network_interface_name, 0x1A8)
  defconst(:property_identifier, :network_number, 0x1A9)
  defconst(:property_identifier, :network_number_quality, 0x1AA)
  defconst(:property_identifier, :network_type, 0x1AB)
  defconst(:property_identifier, :routing_table, 0x1AC)
  defconst(:property_identifier, :virtual_mac_address_table, 0x1AD)
  defconst(:property_identifier, :command_time_array, 0x1AE)
  defconst(:property_identifier, :current_command_priority, 0x1AF)
  defconst(:property_identifier, :last_command_time, 0x1B0)
  defconst(:property_identifier, :value_source, 0x1B1)
  defconst(:property_identifier, :value_source_array, 0x1B2)
  defconst(:property_identifier, :bacnet_ipv6_mode, 0x1B3)
  defconst(:property_identifier, :ipv6_address, 0x1B4)
  defconst(:property_identifier, :ipv6_prefix_length, 0x1B5)
  defconst(:property_identifier, :bacnet_ipv6_udp_port, 0x1B6)
  defconst(:property_identifier, :ipv6_default_gateway, 0x1B7)
  defconst(:property_identifier, :bacnet_ipv6_multicast_address, 0x1B8)
  defconst(:property_identifier, :ipv6_dns_server, 0x1B9)
  defconst(:property_identifier, :ipv6_auto_addressing_enable, 0x1BA)
  defconst(:property_identifier, :ipv6_dhcp_lease_time, 0x1BB)
  defconst(:property_identifier, :ipv6_dhcp_lease_time_remaining, 0x1BC)
  defconst(:property_identifier, :ipv6_dhcp_server, 0x1BD)
  defconst(:property_identifier, :ipv6_zone_index, 0x1BE)
  defconst(:property_identifier, :assigned_landing_calls, 0x1BF)
  defconst(:property_identifier, :car_assigned_direction, 0x1C0)
  defconst(:property_identifier, :car_door_command, 0x1C1)
  defconst(:property_identifier, :car_door_status, 0x1C2)
  defconst(:property_identifier, :car_door_text, 0x1C3)
  defconst(:property_identifier, :car_door_zone, 0x1C4)
  defconst(:property_identifier, :car_drive_status, 0x1C5)
  defconst(:property_identifier, :car_load, 0x1C6)
  defconst(:property_identifier, :car_load_units, 0x1C7)
  defconst(:property_identifier, :car_mode, 0x1C8)
  defconst(:property_identifier, :car_moving_direction, 0x1C9)
  defconst(:property_identifier, :car_position, 0x1CA)
  defconst(:property_identifier, :elevator_group, 0x1CB)
  defconst(:property_identifier, :energy_meter, 0x1CC)
  defconst(:property_identifier, :energy_meter_ref, 0x1CD)
  defconst(:property_identifier, :escalator_mode, 0x1CE)
  defconst(:property_identifier, :fault_signals, 0x1CF)
  defconst(:property_identifier, :floor_text, 0x1D0)
  defconst(:property_identifier, :group_id, 0x1D1)
  defconst(:property_identifier, :group_mode, 0x1D3)
  defconst(:property_identifier, :higher_deck, 0x1D4)
  defconst(:property_identifier, :installation_id, 0x1D5)
  defconst(:property_identifier, :landing_calls, 0x1D6)
  defconst(:property_identifier, :landing_call_control, 0x1D7)
  defconst(:property_identifier, :landing_door_status, 0x1D8)
  defconst(:property_identifier, :lower_deck, 0x1D9)
  defconst(:property_identifier, :machine_room_id, 0x1DA)
  defconst(:property_identifier, :making_car_call, 0x1DB)
  defconst(:property_identifier, :next_stopping_floor, 0x1DC)
  defconst(:property_identifier, :operation_direction, 0x1DD)
  defconst(:property_identifier, :passenger_alarm, 0x1DE)
  defconst(:property_identifier, :power_mode, 0x1DF)
  defconst(:property_identifier, :registered_car_call, 0x1E0)
  defconst(:property_identifier, :active_cov_multiple_subscriptions, 0x1E1)
  defconst(:property_identifier, :protocol_level, 0x1E2)
  defconst(:property_identifier, :reference_port, 0x1E3)
  defconst(:property_identifier, :deployed_profile_location, 0x1E4)
  defconst(:property_identifier, :profile_location, 0x1E5)
  defconst(:property_identifier, :tags, 0x1E6)
  defconst(:property_identifier, :subordinate_node_types, 0x1E7)
  defconst(:property_identifier, :subordinate_tags, 0x1E8)
  defconst(:property_identifier, :subordinate_relationships, 0x1E9)
  defconst(:property_identifier, :default_subordinate_relationship, 0x1EA)
  defconst(:property_identifier, :represents, 0x1EB)

  defconst_extend_env(
    :property_identifier,
    :bacstack,
    :additional_property_identifiers,
    &(&1 != nil and is_integer(&2) and &2 >= 0)
  )

  @doc """
  Any property identifier names that dont match the Clause 21 definition,
  are to be listed here.

  Note that if the difference is only `-` translated to `_`, they are not listed here.
  """
  @spec clause21_translation() :: %{optional(atom()) => String.t()}
  def clause21_translation() do
    # Listed in order of the property identifier number
    %{
      max_output: "maximum-output",
      max_present_value: "max-pres-value",
      min_off_time: "minimum-off-time",
      min_on_time: "minimum-on-time",
      min_output: "minimum-output",
      min_present_value: "min-pres-value",
      event_timestamps: "event-time-stamps",
      max_value: "maximum-value",
      min_value: "minimum-value",
      max_value_timestamp: "maximum-value-timestamp",
      min_value_timestamp: "minimum-value-timestamp"
    }
  end

  @doc """
  Translates a property identifier to the Clause 21 string.

  If the input is a number, it will be resolved to the atom and then translated.
  If the number can't be resolved, `nil` will be returned.
  """
  @spec translate_to_clause21(atom() | non_neg_integer()) ::
          String.t() | nil
  def translate_to_clause21(property_identifier)

  def translate_to_clause21(property_identifier)
      when is_atom(property_identifier) and property_identifier not in [true, false, nil] do
    case Map.fetch(clause21_translation(), property_identifier) do
      {:ok, str} ->
        str

      :error ->
        property_identifier
        |> Atom.to_string()
        |> String.replace("_", "-")
    end
  end

  def translate_to_clause21(property_identifier)
      when is_integer(property_identifier) and property_identifier >= 0 do
    case by_value(:property_identifier, property_identifier) do
      {:ok, id} -> translate_to_clause21(id)
      :error -> nil
    end
  end
end