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

Copy Markdown View Source

This module represents the BACnet I-Have service.

The I-Have service allows a device to advertise that it contains a particular object, identified either by its Object_Identifier or by its Object_Name. It is the counterpart to the Who-Has service and is most often sent in response to a Who-Has broadcast.

Service Description (ASHRAE 135)

The IHave service is used to respond to Who-Has service requests or to advertise the existence of an object with a given Object_Name or Object_Identifier. The I-Have service request may be issued at any time and does not need to be preceded by the receipt of a Who-Has service request.

Service Procedure (ASHRAE 135)

The sending BACnet-user shall broadcast the I-Have unconfirmed request. Such broadcasts may be on the local network only, a remote network only, or globally on all networks at the discretion of the application. If the I-Have is being transmitted in response to a previously received Who-Has, then the I-Have shall be transmitted in such a manner that the BACnet-user that sent the Who-Has will receive the resulting I-Have. Since the request is unconfirmed, no further action is required. A BACnet-user may issue an I-Have service request at any time.

Summary

Types

t()

Parameters for the I-Have service (device + object identifier + object name).

Functions

Whether the service is of type confirmed or unconfirmed.

Converts the given Unconfirmed Service Request into an I-Have Service.

Get the service name atom.

Get the Unconfirmed Service request for the given I-Have Service.

Types

t()

@type t() :: %BACnet.Protocol.Services.IHave{
  device: BACnet.Protocol.ObjectIdentifier.t(),
  object: BACnet.Protocol.ObjectIdentifier.t(),
  object_name: String.t()
}

Parameters for the I-Have service (device + object identifier + object 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 an I-Have Service.

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

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 I-Have Service.

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