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

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

@type nonce() :: <<_::128>>
@type nonce_id() :: byte()
@type option() ::
  {:ttl, non_neg_integer()}
  | {:name, GenServer.name()}
  | {:random_fun, random_fun()}
@type random_fun() :: (bytes :: pos_integer() -> <<_::_*8>>)

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

generate(server \\ __MODULE__, node_id)

View Source
@spec generate(GenServer.server(), node_id :: pos_integer()) ::
  {:ok, nonce()} | :error
@spec start_link([option()]) :: GenServer.on_start()
Link to this function

take(server \\ __MODULE__, node_id, nonce_id)

View Source
@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.