View Source Grizzly.ZWave.CommandClasses.Mailbox (grizzly v7.4.0)

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

@type mode() :: :disabled | :service | :proxy
@type supported_mode() :: :service | :proxy

Functions

@spec decode_mode(0..2) :: mode()
Link to this function

decode_supported_modes(int)

View Source
@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
Link to this function

encode_supported_modes(modes)

View Source
@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