NervesKey.OTP (nerves_key v1.3.0)

View Source

This module handles OTP data stored in the NervesKey.

Summary

Functions

Convert a raw configuration to a nice map.

Convert a raw configuration to a nice map. Raise if there is an error.

Create a NervesKey OTP data struct

Read NervesKey information from the OTP data.

Convert a nice config map back to a raw configuration

Write NervesKey information to the OTP zone.

Types

raw()

@type raw() :: <<_::512>>

t()

@type t() :: %NervesKey.OTP{
  board_name: binary(),
  flags: 0..65535,
  manufacturer_sn: binary(),
  user: <<_::256>>
}

Functions

from_raw(arg1)

@spec from_raw(raw()) :: {:ok, t()} | {:error, atom()}

Convert a raw configuration to a nice map.

from_raw!(raw)

@spec from_raw!(raw()) :: t()

Convert a raw configuration to a nice map. Raise if there is an error.

new(board_name, manufacturer_sn, user \\ nil)

@spec new(String.t(), String.t(), binary() | nil) :: t()

Create a NervesKey OTP data struct

read(transport)

@spec read(ATECC508A.Transport.t()) :: {:ok, t()} | {:error, atom()}

Read NervesKey information from the OTP data.

to_raw(info)

@spec to_raw(t()) :: raw()

Convert a nice config map back to a raw configuration

write(transport, data)

@spec write(ATECC508A.Transport.t(), raw()) :: :ok | {:error, atom()}

Write NervesKey information to the OTP zone.