BACnet.Protocol.Services.Common (bacstack v0.0.1)
View SourceThis 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
@spec after_encode_convert( map(), Keyword.t(), module(), BACnet.Protocol.Constants.confirmed_service_choice() | non_neg_integer() ) :: {:ok, BACnet.Protocol.APDU.ConfirmedServiceRequest.t() | BACnet.Protocol.APDU.UnconfirmedServiceRequest.t()}
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.
@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.
@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.
@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.
@spec decode_text_message( BACnet.Protocol.APDU.ConfirmedServiceRequest.t() | BACnet.Protocol.APDU.UnconfirmedServiceRequest.t() ) :: {:ok, map()} | {:error, term()}
Decodes the unconfirmed or confirmed text message service into a base map.
This function is used by the ConfirmedTextMessage and UnconfirmedTextMessage modules.
@spec encode_cov_notification( BACnet.Protocol.Services.ConfirmedCovNotification.t() | BACnet.Protocol.Services.UnconfirmedCovNotification.t(), Keyword.t() ) :: {:ok, map()} | {:error, term()}
Encodes the unconfirmed or confirmed COV notification service into a base map.
This function is used by the ConfirmedCovNotification and UnconfirmedCovNotification modules.
@spec encode_event_notification( BACnet.Protocol.Services.ConfirmedEventNotification.t() | BACnet.Protocol.Services.UnconfirmedEventNotification.t(), Keyword.t() ) :: {:ok, map()} | {:error, term()}
Encodes the unconfirmed or confirmed event notification service into a base map.
This function is used by the ConfirmedEventNotification and UnconfirmedEventNotification modules.
@spec encode_private_transfer( BACnet.Protocol.Services.ConfirmedPrivateTransfer.t() | BACnet.Protocol.Services.UnconfirmedPrivateTransfer.t(), Keyword.t() ) :: {:ok, map()} | {:error, term()}
Encodes the unconfirmed or confirmed private transfer service into a base map.
This function is used by the ConfirmedPrivateTransfer and UnconfirmedPrivateTransfer modules.
@spec encode_text_message( BACnet.Protocol.Services.ConfirmedTextMessage.t() | BACnet.Protocol.Services.UnconfirmedTextMessage.t(), Keyword.t() ) :: {:ok, map()} | {:error, term()}
Encodes the unconfirmed or confirmed text message service into a base map.
This function is used by the ConfirmedTextMessage and UnconfirmedTextMessage modules.