View Source Grizzly.ZWave.Security.S0NonceTable (grizzly v8.6.6)

This module is used to generate and store S0 nonces in response to incoming Security Nonce Get commands.

Summary

Functions

Returns a specification to start this module under a supervisor.

Takes a nonce from the nonce table. If the nonce is not found, nil is returned. The nonce will be removed from the nonce table.

Types

nonce()

@type nonce() :: <<_::128>>

nonce_id()

@type nonce_id() :: byte()

option()

@type option() ::
  {:ttl, non_neg_integer()}
  | {:name, GenServer.name()}
  | {:random_fun, random_fun()}

random_fun()

@type random_fun() :: (bytes :: pos_integer() -> <<_::_*8>>)

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

generate(server \\ __MODULE__, node_id)

@spec generate(GenServer.server(), node_id :: pos_integer()) ::
  {:ok, nonce()} | :error

start_link(opts \\ [])

@spec start_link([option()]) :: GenServer.on_start()

take(server \\ __MODULE__, node_id, nonce_id)

@spec take(GenServer.server(), node_id :: pos_integer(), nonce_id :: nonce_id()) ::
  nonce() | nil

Takes a nonce from the nonce table. If the nonce is not found, nil is returned. The nonce will be removed from the nonce table.