Search documentation of grizzly

# View Source Grizzly.ZWave.CommandClasses.Mailbox (grizzly v7.4.2)

Mailbox Command Class

See Sections 5.2.3 and 5.2.4 of the Z-Wave Specification.

# Summary

## Types

mode()
supported_mode()

## Functions

decode_mode(int)
decode_supported_modes(int)

Encodes a list of supported modes from a single byte.

encode_mode(atom)
encode_supported_modes(modes)

Encodes a list of supported modes into a single byte.

# Types

Link to this type

# mode()

View Source

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

Link to this type

# supported_mode()

View Source

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

# Functions

Link to this function

# decode_mode(int)

View Source

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

Link to this function

# encode_mode(atom)

View Source

    @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