View Source Grizzly.ZWave.CommandClasses.Mailbox (grizzly v8.6.5)

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

mode()

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

supported_mode()

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

Functions

decode_mode(int)

@spec decode_mode(0..2) :: mode()

decode_supported_modes(int)

@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)
[]

encode_mode(atom)

@spec encode_mode(mode()) :: 0..2

encode_supported_modes(modes)

@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