Search documentation of grizzly

# View Source Grizzly.ZWave.SmartStart.MetaExtension.UUID16 (grizzly v7.4.2)

This is used to advertise 16 bytes of manufactured-defined information that is unique for a given product. Z-Wave UUIDs are not limited to the format outlined in RFC 4122 but can also be ASCII characters and a relevant prefix.

# Summary

## Types

format()

The three formats that the Z-Wave UUID can be formatted in are `:ascii`, `:hex`, or `:rfc4122`.

t()
uuid()

## Functions

encode(uuid16)

Make a binary string from a `UUID16.t()`

new(uuid, format)

Make a new `UUID16.t()`

parse(bin)

Take a binary string and try to make a `UUID16.t()` from it If the critical bit is set in teh binary this will return `{:error, :critical_bit_set}` and the information should be ignored. If the format in the binary is not part of the defined Z-Wave specification this will return `{:error, :invalid_format}`

# Types

Link to this type

# format()

View Source

    @type format() :: :ascii | :hex | :rfc4122

The three formats that the Z-Wave UUID can be formatted in are `:ascii`, `:hex`, or `:rfc4122`.

Both `:ascii` and `:hex` can also have the prefix `sn:` or `UUID:`.

Valid `:hex` formatted UUIDs look like:

- `0102030405060708090A141516171819`
- `sn:0102030405060708090A141516171819`
- `UUID:0102030405060708090A141516171819`

Valid `:ascii` formatted UUIDs look like:

- `Hello Elixir!!!`
- `sn:Hello Elixir!!!`
- `UUID:Hello Elixir!!!`

Lastly `rfc4122` format looks like `58D5E212-165B-4CA0-909B-C86B9CEE0111` where every two digits make up one hex value.

More information about RFC 4122 and the specification format can be found here.

Link to this type

# t()

View Source

    @type t() :: %{uuid: uuid(), format: format()}

Link to this type

# uuid()

View Source

    @type uuid() :: binary()

# Functions

Link to this function

# encode(uuid16)

View Source

    @spec encode(t()) :: binary()

Make a binary string from a `UUID16.t()`

Link to this function

# new(uuid, format)

View Source

    @spec new(String.t(), format()) ::
      {:ok, t()} | {:error, :invalid_uuid_length | :invalid_format}

Make a new `UUID16.t()`

Link to this function

# parse(bin)

View Source

    @spec parse(binary()) :: {:ok, t()} | {:error, any()}

Take a binary string and try to make a `UUID16.t()` from it If the critical bit is set in teh binary this will return `{:error, :critical_bit_set}` and the information should be ignored. If the format in the binary is not part of the defined Z-Wave specification this will return `{:error, :invalid_format}`