BACnet.Protocol.Services.WhoIs (bacstack v0.0.1)

View Source

This module represents the BACnet Who-Is service.

The Who-Is service is used to discover the BACnet network and devices in it.

Service Description (ASHRAE 135):

The Who-Is service is used by a sending BACnet-user to determine the device object identifier, the network address, or both, of other BACnet devices that share the same internetwork. The Who-Is service is an unconfirmed service. The Who-Is service may be used to determine the device object identifier and network addresses of all devices on the network, or to determine the network address of a specific device whose device object identifier is known, but whose address is not. The IAm service is also an unconfirmed service. The I-Am service is used to respond to Who-Is service requests. However, the IAm service request may be issued at any time. It does not need to be preceded by the receipt of a Who-Is service request. In particular, a device may wish to broadcast an I-Am service request when it powers up. The network address is derived either from the MAC address associated with the I-Am service request, if the device issuing the request is on the local network, or from the NPCI if the device is on a remote network.

Summary

Functions

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

Get the service name atom.

Whether the service is of type confirmed or unconfirmed.

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

Types

t()

@type t() :: %BACnet.Protocol.Services.WhoIs{
  device_id_high_limit: non_neg_integer() | nil,
  device_id_low_limit: non_neg_integer() | nil
}

Functions

from_apdu(request)

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

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

get_name()

@spec get_name() :: atom()

Get the service name atom.

is_confirmed()

@spec is_confirmed() :: false

Whether the service is of type confirmed or unconfirmed.

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-Is Service.

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