# `Grizzly.ZWave.SmartStart.MetaExtension.UUID16`
[🔗](https://github.com/smartrent/grizzly/blob/v9.1.4/lib/grizzly/zwave/smart_start/meta_extension/uuid16.ex#L1)

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.

# `format`

```elixir
@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](https://tools.ietf.org/html/rfc4122#section-4.1.2).

# `t`

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

# `uuid`

```elixir
@type uuid() :: binary()
```

# `encode`

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

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

# `new`

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

Make a new `UUID16.t()`

# `parse`

```elixir
@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}`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
