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

Copy Markdown View Source

This module represents the BACnet Write Property Multiple service.

The Write Property Multiple service is used to write to one or more properties of one or more objects, if commandable, with priority.

Service Description (ASHRAE 135)

The WritePropertyMultiple service is used by a client BACnet-user to modify the value of one or more specified properties of a BACnet object. This service potentially allows write access to any property of any object, whether a BACnet-defined object or not. Properties shall be modified by the WritePropertyMultiple service in the order specified in the 'List of Write Access Specifications' parameter, and execution of the service shall continue until all of the specified properties have been written to or a property is encountered that for some reason cannot be modified as requested. Some implementors may wish to restrict write access to certain properties of certain objects. In such cases, an attempt to modify a restricted property shall result in the return of an error of 'Error Class' PROPERTY and 'Error Code' WRITE_ACCESS_DENIED. Note that these restricted properties may be accessible through the use of Virtual Terminal services or other means at the discretion of the implementor.

Service Procedure (ASHRAE 135)

For each 'Write Access Specification' contained in the 'List of Write Access Specifications', the value of each specified property shall be replaced by the property value provided in the 'Write Access Specification' and a 'Result(+)' primitive shall be issued, indicating that the service request was carried out in its entirety. Interpretation of the conditional Priority parameter shall be as specified in Clause 19. If, in the process of carrying out the modification of the indicated properties in the order specified in the 'List of Write Access Specifications', a property is encountered that cannot be modified, the responding BACnet-user shall issue a 'Result(-)' response primitive indicating the reason for the failure. The result of this service shall be either that all of the specified properties or only the properties up to, but not including, the property specified in the 'First Failed Write Attempt' parameter were successfully modified. A BACnet-Reject-PDU shall be issued only if no write operations have been successfully executed, indicating that the service request was rejected in its entirety. If any of the write operations contained in the 'List of Write Access Specifications' have been successfully executed, a Result(-) response indicating the reason for the failure shall be issued as described above.

Result(-) Errors (ASHRAE 135)

The 'Result(-)' parameter shall indicate that at least one of the specified properties could not be modified as requested. The reason for the failure shall be conveyed by the 'Error Type' parameter along with the 'Object Identifier', 'Property Identifier', and 'Property Array Index' of the first encountered property that could not be properly written.

The 'Error Class' and 'Error Code' to be returned in a 'Result(-)' for specific situations are as follows:

SituationError ClassError Code
Specified object does not exist.OBJECTUNKNOWN_OBJECT
Specified property does not exist.PROPERTYUNKNOWN_PROPERTY
An array index is provided but the property is not an array.PROPERTYPROPERTY_IS_NOT_AN_ARRAY
An array index is provided that is outside the range existing in the property.PROPERTYINVALID_ARRAY_INDEX
The specified property is currently read-only.PROPERTYWRITE_ACCESS_DENIED
The datatype of the value provided is incorrect for the specified property.PROPERTYINVALID_DATATYPE
The property is Object_Name and the name is already in use in the device.PROPERTYDUPLICATE_NAME
The property is Object Identifier and the identifier is already in use in the device.PROPERTYDUPLICATE_OBJECT_ID
The value provided is outside the range of values that the property can take on.PROPERTYVALUE_OUT_OF_RANGE
There is not enough space to store the new value.RESOURCESNO_SPACE_TO_WRITE_PROPERTY
The data being written has a datatype not supported by the property.PROPERTYDATATYPE_NOT_SUPPORTED
The Priority parameter is not within the defined range of 1..16. This condition may be ignored if the property is not commandable.SERVICESPARAMETER_OUT_OF_RANGE
A syntax error is encountered in the message after one or more properties have been successfully written.SERVICESINVALID_TAG

Summary

Types

t()

Parameters for the Write Property Multiple service.

Functions

Whether the service is of type confirmed or unconfirmed.

Converts the given Confirmed Service Request into a Write Property Multiple Service.

Get the service name atom.

Get the Confirmed Service request for the given Write Property Multiple Service.

Types

t()

@type t() :: %BACnet.Protocol.Services.WritePropertyMultiple{
  list: [BACnet.Protocol.AccessSpecification.t()]
}

Parameters for the Write Property Multiple service.

Contains a list of Access Specifications, each describing an object and one or more properties with their new values and (for commandable properties) the priority to use for the write.

Functions

confirmed?()

@spec confirmed?() :: true

Whether the service is of type confirmed or unconfirmed.

from_apdu(request)

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

Converts the given Confirmed Service Request into a Write Property Multiple Service.

get_name()

@spec get_name() :: atom()

Get the service name atom.

to_apdu(service, request_data)

@spec to_apdu(t(), Keyword.t()) ::
  {:ok, BACnet.Protocol.APDU.ConfirmedServiceRequest.t()} | {:error, term()}

Get the Confirmed Service request for the given Write Property Multiple Service.

See the BACnet.Protocol.Services.Protocol function documentation for more information.