View Source Grizzly.ZIPGateway.Config (grizzly v8.2.0)

Builds valid zipgateway.cfg based on Grizzly options.

Summary

Functions

Ensure required files are on disk and contain the correct contents

Make a new ZipgatewayCfg.t() from the supplied options

Turn the ZipgatewayCfg.t() into a string

Write the contents of the ZipgatewayCfg.t() to the file system

Types

@type t() :: %Grizzly.ZIPGateway.Config{
  ca_cert: Path.t(),
  cert: Path.t(),
  database_file: Path.t() | nil,
  eeprom_file: Path.t() | nil,
  extra_classes: [byte()],
  extra_config: String.t() | nil,
  hardware_version: non_neg_integer() | nil,
  identify_script: term(),
  lan_gw6: String.t(),
  lan_ip: :inet.ip_address(),
  manufacturer_id: non_neg_integer() | nil,
  pan_ip: :inet.ip_address(),
  power_level:
    {Grizzly.Supervisor.tx_power(), Grizzly.Supervisor.measured_power()} | nil,
  priv_key: Path.t(),
  product_id: non_neg_integer() | nil,
  product_type: non_neg_integer() | nil,
  provisioning_config_file: Path.t(),
  psk: String.t(),
  pvs_storage_file: Path.t(),
  rf_region: Grizzly.Supervisor.rf_region() | nil,
  serial_log: String.t() | nil,
  tun_script: Path.t(),
  unsolicited_destination: {:inet.ip_address(), :inet.port_number()}
}

Functions

@spec ensure_files(t()) :: t()

Ensure required files are on disk and contain the correct contents

This is useful to ensure other tools provided by zipgateway can work.

@spec new(map()) :: t()

Make a new ZipgatewayCfg.t() from the supplied options

@spec to_string(t()) :: String.t()

Turn the ZipgatewayCfg.t() into a string

@spec write(t(), Path.t()) :: :ok | {:error, File.posix()}

Write the contents of the ZipgatewayCfg.t() to the file system