# `Grizzly.ZWave.QRCode`
[🔗](https://github.com/smartrent/grizzly/blob/v9.1.4/lib/grizzly/zwave/qr_code.ex#L1)

Z-Wave QR code
This module handles Z-Wave QR codes that follow Silicon Labs
Software Design Specification SDS13937 and SDS13944.

# `t`

```elixir
@type t() :: %Grizzly.ZWave.QRCode{
  application_version: {byte(), byte()} | nil,
  dsk: Grizzly.ZWave.DSK.t(),
  manufacturer_id: 0..65535,
  product_id: 0..65535,
  product_type: 0..65535,
  requested_keys: [Grizzly.ZWave.Security.key()],
  supported_protocols: any(),
  uuid16: nil | Grizzly.ZWave.SmartStart.MetaExtension.UUID16.t(),
  version: version(),
  zwave_device_type: {atom(), atom()} | 0..65535,
  zwave_installer_icon:
    Grizzly.ZWave.IconType.name() | Grizzly.ZWave.IconType.value()
}
```

Device information
* `:zwave_device_type` - either {generic_device_type, specific_device_type} or a number

# `version`

```elixir
@type version() :: :s2 | :smart_start
```

QR Code version (S2-only or Smart Start-enabled)

# `decode`

```elixir
@spec decode(&lt;&lt;_::16, _::_*8&gt;&gt;) :: {:ok, t()} | {:error, :invalid_dsk}
```

# `encode!`

```elixir
@spec encode!(t()) :: iolist()
```

Encode device information into Z-Wave QR Code format
The output of this is either a 90 byte or 136 byte string that should be put
into a QR Code. Z-Wave specifies that the 90-byte code (no UUID16) is made
into a 29x29 pixel QR Code. The 136-byte* code (w/ UUID16) should be put into
a 33x33 pixel QR Code.
QR Codes should be encoded as type "text" with error correction "L".
NOTE: SDS13937 has a mistake with the code length. It says 134 bytes, but the
UUID16 encode has 2 extra bytes for presentation, so it should be 136.

---

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