BACnet.Protocol.Services.Error.CreateObjectError (bacstack v0.1.0-dev.1)

Copy Markdown View Source

The Create Object Error is returned when a Create Object service request fails.

In addition to the standard error class and error code, it contains the first_failed_element_number which indicates which element in the "List of Initial Values" (if any) caused the failure. A value of 0 means the failure was not related to a specific initial value parameter.

This extra information helps clients understand exactly why object creation failed when they attempted to set initial property values during creation.

Summary

Types

t()

Error details returned when a Create Object request fails, including the first failing element if applicable.

Functions

Converts a received Error APDU into a CreateObjectError struct.

Constructs an Error APDU from a CreateObjectError struct.

Types

t()

@type t() :: %BACnet.Protocol.Services.Error.CreateObjectError{
  error_class: BACnet.Protocol.Constants.error_class() | non_neg_integer(),
  error_code: BACnet.Protocol.Constants.error_code() | non_neg_integer(),
  first_failed_element_number: non_neg_integer()
}

Error details returned when a Create Object request fails, including the first failing element if applicable.

If first_failed_element_number is 0, then the request is not invalid due to the "Initial Value" parameters.

Functions

from_apdu(error)

@spec from_apdu(BACnet.Protocol.APDU.Error.t()) :: {:ok, t()} | {:error, term()}

Converts a received Error APDU into a CreateObjectError struct.

to_apdu(error, invoke_id \\ 0)

@spec to_apdu(t(), 0..255) :: {:ok, BACnet.Protocol.APDU.Error.t()} | {:error, term()}

Constructs an Error APDU from a CreateObjectError struct.

Used by a server when it must reject a Create Object request.