Skip to content

Commit 271690f

Browse files
Add device_info/1 for getting information about the ATECC module
1 parent a1641c8 commit 271690f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/nerves_key/config.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ defmodule NervesKey.Config do
3636
end
3737
end
3838

39+
@doc """
40+
Helper for getting information about the ATECC module.
41+
"""
42+
@spec device_info(ATECC508A.Transport.t()) :: {:error, atom()} | {:ok, map()}
43+
def device_info(transport) do
44+
with {:ok, info} <- Configuration.read(transport) do
45+
{:ok, Map.take(info, [:rev_num])}
46+
end
47+
end
48+
3949
@doc """
4050
Helper for getting the ATECC508A's serial number.
4151
"""

0 commit comments

Comments
 (0)