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

Copy Markdown View Source

This module represents the BACnet Who-Has service.

The Who-Has service allows a client to locate a specific object across the BACnet internetwork when it knows either the object's Object_Identifier or its Object_Name. Devices that contain a matching object respond with an I-Have message containing their own device identifier and the object's identifier and name.

Service Description (ASHRAE 135)

The Who-Has service is used by a sending BACnet-user to identify the device object identifiers and network addresses of other BACnet devices whose local databases contain an object with a given Object_Name or a given Object_Identifier.

Service Procedure (ASHRAE 135)

The sending BACnet-user shall transmit the Who-Has unconfirmed request, normally using a broadcast address. If the 'Device Instance Range Low Limit' and 'Device Instance Range High Limit' parameters are present, then only those receiving BACnet-users whose Device Object_Identifier instance number falls in the range 'Device Instance Range Low Limit' ≤ Object_Identifier Instance Number ≤ 'Device Instance Range High Limit' shall be qualified to respond. If the 'Object Name' parameter is present, then only those qualified receiving BACnet-users that contain an object with an Object_Name property value matching the 'Object Name' parameter shall respond with an I-Have service request. If the 'Object Identifier' parameter is present, then only those qualified receiving BACnet-users that contain an object with an Object_Identifier property value matching the 'Object Identifier' parameter shall respond with an I-Have service request.

Summary

Types

t()

Parameters for the Who-Has service (optional device range + object identifier or name).

Functions

Whether the service is of type confirmed or unconfirmed.

Converts the given Unconfirmed Service Request into a Who-Has Service.

Get the service name atom.

Get the Unconfirmed Service request for the given Who-Has Service.

Types

t()

@type t() :: %BACnet.Protocol.Services.WhoHas{
  device_id_high_limit: non_neg_integer() | nil,
  device_id_low_limit: non_neg_integer() | nil,
  object: BACnet.Protocol.ObjectIdentifier.t() | String.t()
}

Parameters for the Who-Has service (optional device range + object identifier or name).

Functions

confirmed?()

@spec confirmed?() :: false

Whether the service is of type confirmed or unconfirmed.

from_apdu(request)

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

Converts the given Unconfirmed Service Request into a Who-Has 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.UnconfirmedServiceRequest.t()} | {:error, term()}

Get the Unconfirmed Service request for the given Who-Has Service.

Additional supported request_data:

  • encoding: atom() - Optional. The encoding of the object name (defaults to :utf8).

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