### Define Start Options List Type Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Client.html Defines a list of start options for the BACnet client. ```elixir @type start_options() :: [start_option()] ``` -------------------------------- ### Start BACnet Stack Processes Source: https://bacnet-ex.github.io/bacstack/BACnet.html Start the necessary processes for the BACnet stack: IPv4Transport, Segmentator, SegmentsStore, and Client. These should ideally be supervised in a production environment. ```elixir alias BACnet.Stack.Client alias BACnet.Stack.Segmentator alias BACnet.Stack.SegmentsStore alias BACnet.Stack.Transport.IPv4Transport IPv4Transport.open(Client, name: IPv4Transport) Segmentator.start_link(name: Segmentator) SegmentsStore.start_link(name: SegmentsStore) Client.start_link( name: Client, segmentator: Segmentator, segments_store: SegmentsStore, transport: IPv4Transport ) ``` -------------------------------- ### Constructed Data Example Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ApplicationTags.html Example of constructed data, such as Priority Arrays. ```APIDOC ## Constructed Data Example Constructed data can also be a list of values, for example when dealing with Priority Arrays: ```elixir {:constructed, {3, [ null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil ], 0}} ``` ``` -------------------------------- ### start_link Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.ForeignDevice.html Starts and links the BACnet Foreign Device. ```APIDOC ## start_link(opts) ### Description Starts and links the BACnet Foreign Device process. ### Parameters #### Request Body - **bbmd** ({:inet.ip4_address(), 1..65_535}) - Required - The BBMD address. - **client** (client()) - Required - Client and transport information. - **reply_rfd** (boolean) - Optional - Enables replying to Register-Foreign-Device packets (default true). - **ttl** (pos_integer) - Optional - Registration expiry in seconds (default 60). ``` -------------------------------- ### execute_client_request_start Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Telemetry.html Executes telemetry for request start. Requests are started by sending APDU with 'expect_reply: true'. Responses will be emitted for the request through ':stop'. Includes 'destination', 'apdu', and 'send_opts' in metadata. ```APIDOC ## execute_client_request_start ### Description Executes telemetry for request start as `[:bacstack, :client, :request, :start]`. Requests are started by sending APDU with `expect_reply: true`. Responses will be emitted for the request through `:stop`. ### Parameters - `self` (GenServer.server()) - The server instance. - `destination` (term()) - The destination address. - `apdu` (BACnet.Protocol.apdu()) - The APDU data. - `send_opts` (Keyword.t()) - Send options. - `timer` (BACnet.Stack.Client.ApduTimer.t()) - The APDU timer. - `state` (BACnet.Stack.Client.State.t()) - The client state. ### Metadata - `destination`: term() - `apdu`: BACnet.Protocol.apdu() - `send_opts`: Keyword.t() ### Returns - `:ok` ``` -------------------------------- ### open/2 Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Transport.EthernetTransport.html Opens or starts the Transport module. ```APIDOC ## open(callback, opts) ### Description Opens/starts the Transport module. A process is started that is linked to the caller process. ### Parameters - **callback** (transport_callback) - Required - The callback function for the transport. - **opts** (open_options) - Optional - Configuration options including `eth_ifname` and `supervisor`. ``` -------------------------------- ### start_link Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Segmentator.html Starts and links the Segmentator GenServer process. ```APIDOC ## start_link ### Description Starts and links the Segmentator. ### Method N/A (Function Call) ### Parameters - **opts** (start_options()) - Options for starting the Segmentator. The following options need to be given, in addition to `GenServer.options/0`: * `apdu_retries: pos_integer()` - Optional. The amount of APDU sending retries (defaults to 3). * `apdu_timeout: pos_integer()` - Optional. The APDU timeout to be waiting for a response, in ms (defaults to 3000ms). ### Return Value - GenServer.on_start() ``` -------------------------------- ### Start Link Segments Store Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.SegmentsStore.html Starts and links the Segments Store GenServer, allowing configuration of APDU retries and timeouts. ```APIDOC ## start_link(opts) ### Description Starts and links the Segments Store. The following options are available, in addition to `GenServer.options/0`: ### Method `start_link` ### Endpoint `/websites/bacnet-ex_github_io_bacstack/start_link` ### Parameters #### Query Parameters - **opts** (start_options()) - Required - Options for starting the GenServer. - **apdu_retries** (pos_integer()) - Optional - The amount of APDU receiving retries (defaults to 4). Note that this option is only present for testing and must be kept at the default value for BACnet compliance. - **apdu_timeout** (pos_integer()) - Optional - The APDU timeout to be waiting for a response, in ms (defaults to 3000ms). - **max_segments** (Constants.max_segments()) - Optional - The maximum amount of segments to allow (defaults to `:more_than_64`). While `:unspecified` is allowed here, it shouldn't be used anywhere, because it makes it for the server unable to determine if the response is transmittable. Since this setting here does not go to the server, `:unspecified` is allowed here. ### Response #### Success Response (200) - **GenServer.on_start()** - Returns the result of `GenServer.start_link/1`. ``` -------------------------------- ### Define Start Option Type Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Client.html Defines the various options that can be provided when starting or configuring the BACnet client. These include APDU retries, timeouts, transport modules, and more. ```elixir @type start_option() :: {:apdu_retries, pos_integer()} | {:apdu_timeout, pos_integer()} | {:disable_app_timeout, boolean()} | {:disable_invoke_id_management, boolean()} | {:notification_receiver, Process.dest() | [Process.dest()]} | {:npci_source, BACnet.Protocol.NpciTarget.t()} | {:segmentator, BACnet.Stack.Segmentator.server()} | {:segments_store, BACnet.Stack.SegmentsStore.server()} | {:segmented_rcv_window_overwrite, boolean()} | {:transport, module() | {module(), BACnet.Stack.TransportBehaviour.transport()}} | GenServer.option() ``` -------------------------------- ### Constructed Data Examples Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ApplicationTags.html Examples of constructed data containing primitive or context-specific tags. ```elixir {:constructed, {1, {:octet_string, <<11, 22>>}, 0}} {:constructed, {3, {:tagged, {0, <<2, 12, 49, 0>>, 4}}, 0}} ``` -------------------------------- ### Constructed Data Priority Array Example Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ApplicationTags.html Example of representing a Priority Array as a list of values within a constructed encoding. ```elixir {:constructed, {3, [ null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil, null: nil ], 0}} ``` -------------------------------- ### Register as a Foreign Device Source: https://bacnet-ex.github.io/bacstack/BACnet.html Start the ForeignDevice process to register with a BBMD, allowing interaction with a remote BACnet network. Ensure the Client is started on the correct network interface. ```elixir alias BACnet.Stack.ForeignDevice ForeignDevice.start_link(bbmd: {bbmd_ip, 0xBAC0}, client: Client) ``` -------------------------------- ### start_link/1 Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Client.html Starts and links the BACnet Client process with specific configuration options. ```APIDOC ## start_link(opts) ### Description Starts and links the BACnet Client. The function accepts various configuration options for APDU handling, notification routing, and transport layers. ### Parameters #### Request Body - **apdu_retries** (pos_integer) - Optional - The amount of APDU sending retries (defaults to 3). - **apdu_timeout** (pos_integer) - Optional - The APDU timeout in ms (defaults to 3000ms). - **disable_app_timeout** (boolean) - Optional - Disables the application timeout mechanism. - **disable_invoke_id_management** (boolean) - Optional - Disables invoke_id management. - **notification_receiver** (Process.dest | [Process.dest]) - Optional - The destination to send messages to. - **npci_source** (NpciTarget.t) - Optional - The NPCI target to use as source. - **segmentator** (Segmentator.server) - Required - The segmentator server to use. - **segments_store** (SegmentsStore.server) - Required - The segments store server to use. - **segmented_rcv_window_overwrite** (boolean) - Optional - Enable to overwrite the window size to 1 for incoming segmented APDUs. - **transport** (module | {module, TransportBehaviour.transport}) - Required - The transport to use. ``` -------------------------------- ### Get Transport Portal Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.TransportBehaviour.html Callback function to get the portal associated with a transport. ```APIDOC ## get_portal(transport) ### Description Get the transport module portal for the given transport PID/port. Transport modules may return the input as output, if the same PID or port is used for sending. This is used to get the portal before having received data from the transport module, so data can be sent prior to reception. ### Callback Signature ```elixir @callback get_portal(transport :: transport()) :: portal() ``` ``` -------------------------------- ### start_link(opts) Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.TrendLogger.html Starts and links the trend logger process with specified configuration options. ```APIDOC ## start_link(opts) ### Description Starts and links the trend logger. The function accepts various options to configure COV subscriptions, log buffers, object lookups, and notification receivers. ### Parameters #### Request Body - **cov_cb** (function) - Optional - Callback for COV subscriptions. - **log_buffer_module** (module) - Optional - Module implementing LogBufferBehaviour. - **lookup_cb** (function) - Required - Callback to look up local or remote objects. - **notification_receiver** (Process.dest) - Optional - Recipient for notifications. - **state** (State.t) - Optional - Pre-existing state for reinitialization. - **supervisor** (Supervisor.supervisor) - Optional - Task supervisor. - **timezone** (Calendar.time_zone) - Optional - Timezone for timestamps. ``` -------------------------------- ### Define Segmentator Start Options List Type Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Segmentator.html Defines the type for a list of valid start options for the Segmentator module. ```Elixir @type start_options() :: [start_option()] ``` -------------------------------- ### create(instance_number, object_name, properties, opts) Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.MultistateValue.html Creates a new object struct with the defined properties. Optional properties are ignored if not provided. Properties with a value of `nil` are also ignored. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Method `create/4` ### Parameters - **instance_number** (non_neg_integer()) - The instance number for the new object. - **object_name** (String.t()) - The name for the new object. - **properties** (%{optional(property_name() | atom() | non_neg_integer()) => term()}) - A map of properties to initialize the object with. - **opts** ([object_opts() | internal_metadata()]) - Optional arguments for object creation. ### Returns - `{:ok, t()}` - If the object was created successfully. - `property_update_error()` - If there was an error creating the object. ``` -------------------------------- ### Get and Update Priority Array Value Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.PriorityArray.html Atomically gets the value from a key and updates it in the priority array. This is useful for concurrent operations. ```elixir get_and_update(array, key, fun) ``` -------------------------------- ### start_option() Type Definition Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.TrendLogger.html Defines the possible options for starting the trend logger. Each option specifies a different configuration or callback mechanism. ```elixir @type start_option() :: {:cov_cb, (pid(), BACnet.Protocol.DeviceObjectPropertyRef.t(), :sub | :unsub, non_neg_integer(), float() | nil -> :ok | {:error, term()})} | {:log_buffer_module, BACnet.Stack.LogBufferBehaviour.mod()} | {:lookup_cb, (BACnet.Protocol.DeviceObjectRef.t() -> {:ok, BACnet.Protocol.ObjectsUtility.bacnet_object()} | {:error, BACnet.Protocol.BACnetError.t()})} | {:notification_receiver, Process.dest()} | {:state, BACnet.Stack.TrendLogger.State.t()} | {:supervisor, Supervisor.supervisor()} | {:timezone, Calendar.time_zone()} | GenServer.option() ``` -------------------------------- ### Execute Segmentator Sequence Start Telemetry Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Telemetry.html Executes telemetry for the start of a segmentator sequence. The `sequence` argument is part of the event metadata. ```elixir @spec execute_segmentator_sequence_start( GenServer.server(), BACnet.Stack.Segmentator.Sequence.t(), BACnet.Stack.Segmentator.State.t() ) :: :ok ``` -------------------------------- ### Execute Trend Logger Lookup Object Start Telemetry Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Telemetry.html Executes telemetry for the start of an object lookup operation, typically used for poll logs. ```elixir @spec execute_trend_logger_lookup_object_start( GenServer.server(), BACnet.Protocol.DeviceObjectRef.t() ) :: :ok ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.Program.html Creates a new Program object struct with specified properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters - **instance_number** (non_neg_integer()) - Required - The instance number for the object. - **object_name** (String.t()) - Required - The name of the object. - **properties** (map()) - Optional - A map of property names to values. - **opts** (list()) - Optional - Additional object options or metadata. ### Response - **Success** ({:ok, t()}) - Returns the newly created object. - **Error** (property_update_error()) - Returns an error if creation fails. ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.File.html Creates a new File object struct with the defined properties and options. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description Creates a new File 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. ### Parameters - **instance_number** (non_neg_integer) - Required - The instance number of the object. - **object_name** (String.t) - Required - The name of the object. - **properties** (map) - Optional - A map of property names to values. - **opts** (list) - Optional - A list of object options or internal metadata. ``` -------------------------------- ### Define Segmentator Start Options Type Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Segmentator.html Defines the valid start options for the Segmentator module, including APDU retries, timeouts, and GenServer options. ```Elixir @type start_option() :: {:apdu_retries, pos_integer()} | {:apdu_timeout, pos_integer()} | GenServer.option() ``` -------------------------------- ### start_link Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.BBMD.html Starts and links the BACnet Broadcast Management Device (BBMD) with various configuration options. ```APIDOC ## start_link(opts) ### Description Starts and links the BACnet Broadcast Management Device. The following options are available, in addition to `GenServer.options/0`: ### Method N/A (Function Call) ### Endpoint N/A (Function Call) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```elixir start_link(opts) ``` ### Response #### Success Response (200) `GenServer.on_start()` #### Response Example ```elixir {:ok, pid} ``` ### Options * `bdt: [BroadcastDistributionTableEntry.t()]` - Optional. The Broadcast Distribution Table to distribute broadcasts to peers. * `bdt_readonly: boolean()` - Optional. Whether the Broadcast Distribution Table is readonly on the BACnet side. By default the BDT can be written to and changed. Setting this to `true` will only allow writes through the Elixir side. * `client: client()` - Required. The client & transport information. * `max_fd_registrations: pos_integer()` - Optional. The amount of Foreign Device registrations that can be accepted are limited by this option (defaults to `512`). That is by design to not allow an unlimited number of registrations to be accumulated with a long Time-To-Live. Only up to the given number will be accepted at most concurrently, any further registration will be rejected and must wait until one registration times out or gets deleted to allow a new registration to be accepted. The maximum Time-To-Live is `65_535` seconds (ca. 18h 12mins), as per ASHRAE 135 J.5.2.1. * `override_port: 47_808..65_535` - Optional. Overrides the used broadcast port (defaults to transport port number). * `paused: boolean()` - Optional. Start in paused state. See also `pause_fd_registration/1` and `resume_fd_registration/1`. * `proxy_mode: boolean()` - Optional. This is an alternate mode to the BBMD operation as described in ASHRAE 135 Annex J.4.5. Instead of broadcasting received BVLL `Distribute-Broadcast-To-Network` as `Forwarded-NPDU`, it will do a regular broadcast. Which means the devices will respond unicast to the BBMD. The BBMD will forward all received `IAm` and `IHave` NPDUs to all Foreign Devices, even if the Foreign Device has not sent a request for `WhoIs` or the request has been long ago executed. This mode is only for development and testing purposes. It should not be used in production for regular BBMD operation. ``` -------------------------------- ### Open transport module Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Transport.EthernetTransport.html Starts the transport module process and links it to the caller. Requires a callback and optional configuration for interface and supervision. ```elixir @spec open( callback :: BACnet.Stack.TransportBehaviour.transport_callback(), opts :: open_options() ) :: {:ok, pid()} | {:error, term()} ``` -------------------------------- ### Create a new algorithm state Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.EventAlgorithms.ChangeOfBitstring.html Initializes a new state for the ChangeOfBitstring algorithm. ```elixir @spec new(tuple(), BACnet.Protocol.EventParameters.ChangeOfBitstring.t()) :: t() ``` -------------------------------- ### Get Current UTC BACnet DateTime Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.BACnetDateTime.html Creates a new BACnet DateTime struct representing the current date and time in UTC. This is a convenient way to get a timestamp for logging or other time-sensitive operations. ```elixir @spec utc_now() :: t() ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.BinaryInput.html Creates a new BinaryInput object struct with the defined properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters - **instance_number** (non_neg_integer) - Required - **object_name** (String.t) - Required - **properties** (map) - Optional - Map of property names to values - **opts** (list) - Optional - Object options or internal metadata ### Response - **Success** (tuple) - {:ok, t()} - **Error** (tuple) - {:error, {error :: atom(), property :: BACnet.Protocol.Constants.property_identifier()}} ``` -------------------------------- ### Get Transport Module Portal Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Transport.IPv4Transport.html Obtains the transport module portal for a given transport PID or port. This function can be used to get the portal before receiving data, allowing data to be sent prior to reception. ```elixir @spec get_portal(GenServer.server()) :: port() ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.EventEnrollment.html Creates a new Event Enrollment object struct with the specified properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters - **instance_number** (non_neg_integer()) - Required - The instance number of the object. - **object_name** (String.t()) - Required - The name of the object. - **properties** (map()) - Optional - Map of property names to values. - **opts** (list()) - Optional - Object options or internal metadata. ### Response - **{:ok, t()}** - Success response with the created object. - **property_update_error()** - Error response. ``` -------------------------------- ### create Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.Command.html Creates a new object struct with specified properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters - **instance_number** (non_neg_integer()) - Required - The instance number for the object. - **object_name** (String.t()) - Required - The name of the object. - **properties** (map) - Optional - A map of property names to values. - **opts** (list) - Optional - Additional options or metadata. ### Response - **{:ok, t()}** - Success response with the created object. - **property_update_error()** - Error response if creation fails. ``` -------------------------------- ### Get Annotations Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.MultistateOutput.html Retrieves a list of all annotations for each property. ```APIDOC ## GET /get_annotations ### Description Auto generated function to get the list of annotations for each property. ### Method GET ### Endpoint `/get_annotations` ### Parameters None ### Response #### Success Response (200) - **annotations** ([{name :: property_name(), values :: [term()]}]) - A list of tuples, where each tuple contains a property name and its associated annotations. ``` -------------------------------- ### execute_segmentator_sequence_start Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Telemetry.html Executes telemetry for the start of a segmentator sequence. ```APIDOC ## execute_segmentator_sequence_start ### Description Executes telemetry for sequence start as `[:bacstack, :segmentator, :sequence, :start]`. ### Parameters - **sequence** (BACnet.Stack.Segmentator.Sequence.t()) - Required - The sequence object. - **state** (BACnet.Stack.Segmentator.State.t()) - Required - The current segmentator state. ``` -------------------------------- ### Implement open() callback Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.TransportBehaviour.html Callback to open or start the Transport module. It takes a callback for message handling and options. The opened transport is linked to the caller. ```elixir @callback open( callback :: transport_callback(), opts :: Keyword.t() ) :: {:ok, transport :: transport()} | {:error, term()} ``` -------------------------------- ### Make Stacktrace from Environment Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Telemetry.html Generates a single stacktrace entry from the provided macro environment, useful for exception reporting without a real stacktrace. ```elixir @spec make_stacktrace_from_env(Macro.Env.t()) :: Exception.stacktrace_entry() ``` -------------------------------- ### get_buffer Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.TrendLogger.html Get the log buffer contents for the given object. ```APIDOC ## GET /get_buffer ### Description Retrieves the log buffer contents for the specified object. ### Method GET ### Parameters #### Query Parameters - **server** (server()) - Required - The trend logger server reference. - **object** (object()) - Required - The target object. ### Response #### Success Response (200) - **buffer_data** ({current_sequence_number :: non_neg_integer(), buffer_module :: module(), buffer :: BACnet.Stack.LogBufferBehaviour.t()}) - The buffer contents. ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.AnalogInput.html Creates a new Analog Input object struct with the specified instance number, name, and optional properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters - **instance_number** (non_neg_integer) - Required - The instance number of the object. - **object_name** (String.t) - Required - The name of the object. - **properties** (map) - Optional - A map of property names to values. - **opts** (list) - Optional - Additional object options or internal metadata. ### Response - **{:ok, t()}** - Success response containing the created object. - **property_update_error()** - Error response if creation fails. ``` -------------------------------- ### Get Annotation Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.MultistateOutput.html Retrieves annotations for a specific property name. ```APIDOC ## GET /get_annotation ### Description Auto generated function to get the annotations for the given property name. ### Method GET ### Endpoint `/get_annotation` ### Parameters #### Query Parameters - **name** (property_name()) - Required - The name of the property to get annotations for. ### Response #### Success Response (200) - **annotations** ([term()]) - A list of annotations for the specified property. ``` -------------------------------- ### Create BACnet Encoding Struct (Bang Version) Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ApplicationTags.Encoding.html Bang version of `create/2`. Raises an error if the encoding creation fails. ```Elixir @spec create!(BACnet.Protocol.ApplicationTags.encoding(), create_options()) :: t() | no_return() ``` -------------------------------- ### Create buffer from list Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.LogBuffer.html Initializes a new log buffer from an existing list. ```elixir @spec from_list(list(), pos_integer() | nil) :: t() ``` -------------------------------- ### Get Property Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.Loop.html Retrieves the value of a specific property from an object. ```APIDOC ## GET /property ### Description Get a property's value from an object. ### Method GET ### Endpoint /property ### Parameters #### Query Parameters - **object** (t()) - Required - The BACnet object. - **property** (BACnet.Protocol.Constants.property_identifier() | non_neg_integer()) - Required - The property identifier or index. ### Response #### Success Response (200) - **value** (term()) - The value of the property. #### Error Response (400) - **error** (property_update_error()) - An error occurred while retrieving the property. ``` -------------------------------- ### Get All Annotations Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.LargeAnalogValue.html Retrieves a list of all annotations for each property of the object. ```APIDOC ## get_annotations() ### Description Auto generated function to get the list of annotations for each property. ### Returns - `[{name :: property_name(), values :: [term()]}]` - A list of tuples, where each tuple contains the property name and its associated annotations. ``` -------------------------------- ### Configure BACnet Client Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.Client.html Configures the BACnet client with specified options. Only a subset of start options can be modified after initialization; others require a client restart. ```elixir @spec configure(server(), start_options()) :: :ok ``` -------------------------------- ### Get Property Annotation Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.LargeAnalogValue.html Retrieves the annotations for a specific property. ```APIDOC ## get_annotation(name) ### Description Auto generated function to get the annotations for the given property name. ### Parameters #### Path Parameters - **name** (property_name()) - The name of the property to get annotations for. ### Returns - `[term()]` - A list of annotations for the specified property. ``` -------------------------------- ### Create new buffer Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.LogBuffer.html Initializes an empty log buffer with an optional maximum size. ```elixir @spec new(pos_integer() | nil) :: t() ``` -------------------------------- ### Get Properties Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.Loop.html Retrieves the list of properties that an object possesses. ```APIDOC ## GET /properties ### Description Get the list of properties the object has. ### Method GET ### Endpoint /properties ### Parameters #### Query Parameters - **object** (t()) - Required - The BACnet object. ### Response #### Success Response (200) - **properties** ([BACnet.Protocol.Constants.property_identifier()]) - The list of properties the object has. ``` -------------------------------- ### Create new array Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.BACnetArray.html Initializes a new array with an optional fixed size and default value. ```elixir @spec new(non_neg_integer() | nil, term()) :: t() ``` -------------------------------- ### Get intrinsic properties Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.BinaryInput.html Retrieves the names of intrinsic properties. ```Elixir @spec get_intrinsic_properties() :: [BACnet.Protocol.Constants.property_identifier()] ``` -------------------------------- ### Object Creation Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.TimePatternValue.html Functions for creating and initializing BACstack objects. ```APIDOC ## Create Object (`create/4`) ### Description 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. ### Method `create/4` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **instance_number** (non_neg_integer()) - The instance number for the new object. - **object_name** (String.t()) - The name for the new object. - **properties** (%{optional(property_name() | atom() | non_neg_integer()) => term()}) - A map of properties to initialize the object with. - **opts** ([object_opts() | internal_metadata()]) - Optional configuration options for object creation. ### Response #### Success Response (200) - **{:ok, t()}** - Successfully created object. #### Error Response - **property_update_error()** - An error occurred during property update. ### Request Example ```elixir # Example usage (assuming BACnet module is imported) {:ok, time_pattern_object} = BACnet.Protocol.ObjectTypes.TimePatternValue.create(1, "MyTimePattern", %{present_value: BACnet.Protocol.BACnetTime.new(10, 30, 0)}) ``` ## Add Property (`add_property/3`) ### Description 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`. ### Method `add_property/3` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **object** (t()) - The object to add the property to. - **property** (BACnet.Protocol.Constants.property_identifier()) - The identifier of the property to add. - **value** (term()) - The value of the property to add. ### Response #### Success Response (200) - **{:ok, t()}** - The object with the added property. #### Error Response - **property_update_error()** - An error occurred while adding the property. ``` -------------------------------- ### Get all property annotations Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.BinaryInput.html Retrieves the list of annotations for each property. ```Elixir @spec get_annotations() :: [{name :: property_name(), values :: [term()]}] ``` -------------------------------- ### Get array size Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.BACnetArray.html Returns the current size of the array. ```elixir @spec size(t()) :: non_neg_integer() ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.Device.html Creates a new BACnet object struct. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description Creates a new object struct with defined properties. Optional properties are only created if provided; properties with nil values are ignored. ### Parameters - **instance_number** (non_neg_integer) - Required - **object_name** (String.t) - Required - **properties** (map) - Optional map of properties - **opts** (list) - Optional configuration options ### Response - **{:ok, t()}** - Success - **property_update_error()** - Failure ``` -------------------------------- ### Start BACnet Broadcast Management Device Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.BBMD.html Starts and links the BACnet Broadcast Management Device (BBMD). Various options are available to configure its behavior, including Broadcast Distribution Table (BDT) settings, client transport, maximum registrations, port overrides, and proxy mode. ```elixir @spec start_link(start_options()) :: GenServer.on_start() ``` -------------------------------- ### create/4 Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ObjectTypes.BinaryOutput.html Creates a new object struct with defined properties. ```APIDOC ## create(instance_number, object_name, properties, opts) ### Description 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. ### Parameters #### Arguments - **instance_number** (non_neg_integer) - Required - **object_name** (String.t) - Required - **properties** (map) - Required - Map of property names to values - **opts** (list) - Optional - List of object options or internal metadata ### Response - **Success** ({:ok, t}) - Returns the created object struct - **Error** (property_update_error) - Returns an error if creation fails ``` -------------------------------- ### BACnet.Protocol.EnrollmentSummary Functions Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.EnrollmentSummary.html API reference for encoding, parsing, and validating BACnet enrollment summary structures. ```APIDOC ## encode(summary, opts) ### Description Encodes a BACnet enrollment summary into BACnet application tags encoding. ### Parameters - **summary** (t()) - Required - The enrollment summary struct to encode. - **opts** (Keyword.t()) - Optional - Encoding options. ### Response - **Success** ({:ok, encoding_list}) - Returns the encoded application tags. - **Error** ({:error, term()}) - Returns an error if encoding fails. ## parse(tags) ### Description Parses a BACnet enrollment summary from BACnet application tags encoding. ### Parameters - **tags** (encoding_list) - Required - The list of application tags to parse. ### Response - **Success** ({:ok, {t(), rest}}) - Returns the parsed struct and the remaining tags. - **Error** ({:error, term()}) - Returns an error if parsing fails. ## valid?(t) ### Description Validates whether the given enrollment summary struct is valid according to the type specification. ### Parameters - **t** (t()) - Required - The enrollment summary struct to validate. ### Response - **Result** (boolean) - Returns true if valid, false otherwise. ``` -------------------------------- ### Nested Constructed Data Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ApplicationTags.html Example of nested constructed data structures. ```elixir {:constructed, {12, {:constructed, {6, [ tagged: {0, "U", 1}, constructed: {2, {:real, 1.0}, 0} ], 0}}, 0}} ``` -------------------------------- ### BACnet.Protocol.ActionList Functions Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.ActionList.html API documentation for the functions within the BACnet.Protocol.ActionList module. ```APIDOC ## encode/2 ### Description Encode a BACnet action list into application tag-encoded format. ### Method N/A (Function within a module) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **{:ok, BACnet.Protocol.ApplicationTags.encoding_list()}** - The encoded action list. - **{:error, term()}** - An error occurred during encoding. #### Response Example N/A ``` ```APIDOC ## parse/1 ### Description Parse a BACnet action list from application tags encoding. ### Method N/A (Function within a module) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **{:ok, {BACnet.Protocol.ActionList.t(), BACnet.Protocol.ApplicationTags.encoding_list()}}** - A tuple containing the parsed action list and the remaining tags. - **{:error, term()}** - An error occurred during parsing. #### Response Example N/A ``` ```APIDOC ## valid?/1 ### Description Validates whether the given action list is in a valid form. It only validates the struct is valid as per type specification. ### Method N/A (Function within a module) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **boolean()** - True if the action list is valid, false otherwise. #### Response Example N/A ``` -------------------------------- ### Get buffer size Source: https://bacnet-ex.github.io/bacstack/BACnet.Stack.LogBuffer.html Returns the current number of items in the buffer. ```elixir @spec get_size(t()) :: non_neg_integer() ``` -------------------------------- ### Create new algorithm state Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.EventAlgorithms.UnsignedRange.html Initializes a new state for the UnsignedRange algorithm. ```elixir @spec new(non_neg_integer(), BACnet.Protocol.EventParameters.UnsignedRange.t()) :: t() ``` -------------------------------- ### BACnet.Protocol.Services.GetEventInformation Source: https://bacnet-ex.github.io/bacstack/BACnet.Protocol.Services.GetEventInformation.html API documentation for the Get Event Information service module. ```APIDOC ## BACnet.Protocol.Services.GetEventInformation ### Description The Get Event Information service is used to obtain a summary of all active event states from a device, specifically for event-initiating objects that are not in a NORMAL state or have unacknowledged transitions. ### Types - **t()** - A struct representing the service: %BACnet.Protocol.Services.GetEventInformation{last_received_object_identifier: BACnet.Protocol.ObjectIdentifier.t() | nil} ### Functions - **confirmed?()** - Returns true, indicating the service is of type confirmed. - **from_apdu(request)** - Converts a ConfirmedServiceRequest into a Get Event Information Service struct. - **get_name()** - Returns the service name atom. - **to_apdu(service, request_data)** - Generates a Confirmed Service request for the given service instance. ```