grizzly v0.8.2 Grizzly.SmartStart.MetaExtension.ProductId View Source

This Information Type is used to advertise the product identifying data of a supporting node.

Link to this section Summary

Functions

Make a ProductId.t() from a binary string

Build a binary from a ProductId.t()

Link to this section Types

Link to this type

param() View Source
param() :: :manufacturer_id | :product_type | :product_id | :application_version

Link to this type

t() View Source
t() :: %Grizzly.SmartStart.MetaExtension.ProductId{
  application_version: {byte(), byte()},
  manufacturer_id: u16(),
  product_id: u16(),
  product_type: u16()
}

Link to this type

u16() View Source
u16() :: 0..65535

Link to this section Functions

Link to this function

from_binary(arg1) View Source
from_binary(binary()) ::
  {:ok, t()} | {:error, :critical_bit_set | :invalid_binary}

Make a ProductId.t() from a binary string

According to the specification for this extension the critical bit must not be set. If it is then the binary is not consider valid and should be ignored.

Link to this function

new(manufacturer_id, product_id, product_type, application_version) View Source
new(
  manufacturer_id :: u16(),
  product_id :: u16(),
  product_type :: u16(),
  application_version :: {byte(), byte()}
) :: {:ok, t()} | {:error, :invalidate_param, param(), any()}

Make a new ProductId.t()

If a param is invalid this function will return {:error, :invalid_params, param(), param_value}

Link to this function

to_binary(product_id) View Source
to_binary(t()) :: {:ok, binary()}

Build a binary from a ProductId.t()

The arguments for the params() other than application version should be unsigned 16 bit integers.