View Source Grizzly.ZWave.CommandClasses.Mailbox (grizzly v8.6.6)
Mailbox Command Class
See Sections 5.2.3 and 5.2.4 of the Z-Wave Specification.
Summary
Functions
Encodes a list of supported modes from a single byte.
Encodes a list of supported modes into a single byte.
Types
Functions
@spec decode_mode(0..2) :: mode()
@spec decode_supported_modes(0..3) :: [supported_mode()]
Encodes a list of supported modes from a single byte.
Examples
iex> decode_supported_modes(3)
[:service, :proxy]
iex> decode_supported_modes(2)
[:proxy]
iex> decode_supported_modes(1)
[:service]
iex> decode_supported_modes(0)
[]
@spec encode_mode(mode()) :: 0..2
@spec encode_supported_modes([supported_mode()]) :: 0..3
Encodes a list of supported modes into a single byte.
Examples
iex> encode_supported_modes([:service, :proxy])
3
iex> encode_supported_modes([:proxy])
2
iex> encode_supported_modes([:service])
1
iex> encode_supported_modes([])
0