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

View Source

This module implements the parsing for some services, which are available as both confirmed and unconfirmed. So instead of implementing the same parsing and encoding twice, this module is the common ground for these services.

Summary

Functions

After encode, this function can be used to turn the request parameters into a service request.

Decodes the unconfirmed or confirmed cov notification service into a base map.

Decodes the unconfirmed or confirmed event notification service into a base map.

Decodes the unconfirmed or confirmed private transfer service into a base map.

Decodes the unconfirmed or confirmed text message service into a base map.

Encodes the unconfirmed or confirmed COV notification service into a base map.

Encodes the unconfirmed or confirmed event notification service into a base map.

Encodes the unconfirmed or confirmed private transfer service into a base map.

Encodes the unconfirmed or confirmed text message service into a base map.

Functions

after_encode_convert(request, request_data, service_type, service_name)

After encode, this function can be used to turn the request parameters into a service request.

This function is used in the Services.* modules. Any wrong usage can only be blamed onto the user themself.

decode_cov_notification(request)

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

Decodes the unconfirmed or confirmed cov notification service into a base map.

This function is used by the ConfirmedCovNotification and UnconfirmedCovNotification modules.

decode_event_notification(request)

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

Decodes the unconfirmed or confirmed event notification service into a base map.

This function is used by the ConfirmedEventNotification and UnconfirmedEventNotification modules.

decode_private_transfer(request)

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

Decodes the unconfirmed or confirmed private transfer service into a base map.

This function is used by the ConfirmedPrivateTransfer and UnconfirmedPrivateTransfer modules.

decode_text_message(request)

Decodes the unconfirmed or confirmed text message service into a base map.

This function is used by the ConfirmedTextMessage and UnconfirmedTextMessage modules.

encode_cov_notification(service, opts \\ [])

Encodes the unconfirmed or confirmed COV notification service into a base map.

This function is used by the ConfirmedCovNotification and UnconfirmedCovNotification modules.

encode_event_notification(service, opts \\ [])

Encodes the unconfirmed or confirmed event notification service into a base map.

This function is used by the ConfirmedEventNotification and UnconfirmedEventNotification modules.

encode_private_transfer(service, opts \\ [])

Encodes the unconfirmed or confirmed private transfer service into a base map.

This function is used by the ConfirmedPrivateTransfer and UnconfirmedPrivateTransfer modules.

encode_text_message(request, opts \\ [])

Encodes the unconfirmed or confirmed text message service into a base map.

This function is used by the ConfirmedTextMessage and UnconfirmedTextMessage modules.