Skip to content
Permalink
Browse files

Add device_info/1 for getting information about the ATECC module

  • Loading branch information...
mobileoverlord committed May 21, 2019
1 parent a1641c8 commit 271690f52d7e6888470704946d229903f171a7c7
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/nerves_key/config.ex
@@ -36,6 +36,16 @@ defmodule NervesKey.Config do
end
end

@doc """
Helper for getting information about the ATECC module.
"""
@spec device_info(ATECC508A.Transport.t()) :: {:error, atom()} | {:ok, map()}
def device_info(transport) do
with {:ok, info} <- Configuration.read(transport) do
{:ok, Map.take(info, [:rev_num])}
end
end

@doc """
Helper for getting the ATECC508A's serial number.
"""

0 comments on commit 271690f

Please sign in to comment.
You can’t perform that action at this time.