View Source Grizzly.ZWave.SmartStart.MetaExtension.UUID16 (grizzly v8.6.6)

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

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

t()

Functions

Make a binary string from a UUID16.t()

Make a new UUID16.t()

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

format()

@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.

t()

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

uuid()

@type uuid() :: binary()

Functions

encode(uuid16)

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

Make a binary string from a UUID16.t()

new(uuid, format)

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

Make a new UUID16.t()

parse(bin)

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