Utilities for encoding and decoding command classes and command class lists.
Summary
Functions
Turn the binary representation that is outlined in the Network-Protocol specs
Turn the list of command classes into the binary representation outlined in the Network-Protocol command class specification.
Merges command class lists in a way that's more resilient to some Z/IP Gateway bugs. The list provided in the second argument is merged into the first.
Get the byte representation of the command class
Types
Functions
@spec command_class_list_from_binary(binary()) :: [command_class_list()]
Turn the binary representation that is outlined in the Network-Protocol specs
@spec command_class_list_to_binary([command_class_list()]) :: binary()
Turn the list of command classes into the binary representation outlined in the Network-Protocol command class specification.
TODO: add more details
@spec from_byte(byte()) :: {:ok, command_class()} | {:error, :unsupported_command_class}
@spec merge(command_class_list(), command_class_list()) :: command_class_list()
Merges command class lists in a way that's more resilient to some Z/IP Gateway bugs. The list provided in the second argument is merged into the first.
In particular, there's a Z/IP Gateway bug where it can lose track of a node's supported command classes. If this happens while the node is failing, a Node Info Cached Report can come back with an empty command class list. If requesting the NIF works but the controller doesn't receive an S0/S2 Commands Supported Report (e.g. due to interference), the secure command class lists will be empty.
@spec to_byte(command_class()) :: byte()
Get the byte representation of the command class
@spec valid?(command_class()) :: boolean()