View Source Grizzly.ZWave.QRCode (grizzly v8.5.3)

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

Summary

Types

t()

Device information

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

Functions

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.

Types

@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
@type version() :: :s2 | :smart_start

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

Functions

@spec decode(<<_::16, _::_*8>>) :: {:ok, t()} | {:error, :invalid_dsk}
@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.