View Source NervesKey.OTP (nerves_key v1.2.0)

This module handles OTP data stored in the NervesKey.

Link to this section 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.

Link to this section Types

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

Link to this section Functions

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

Convert a raw configuration to a nice map.

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

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

Link to this function

new(board_name, manufacturer_sn, user \\ nil)

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

Create a NervesKey OTP data struct

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

Read NervesKey information from the OTP data.

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

Convert a nice config map back to a raw configuration

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

Write NervesKey information to the OTP zone.