View Source NervesHubLink.FwupConfig (nerves_hub_link v2.6.0)

Config structure responsible for handling callbacks from FWUP, applying a fwupdate, and storing fwup task configuration

Summary

Types

handle_fwup_message will be called with this data

Callback that will be called during the lifecycle of a fwupdate being applied

t()

Called when an update has been dispatched via NervesHubLink.UpdateManager.apply_update/2

Functions

Raises an ArgumentError on invalid arguments

Types

fwup_message()

@type fwup_message() ::
  {:progress, non_neg_integer()}
  | {:warning, non_neg_integer(), String.t()}
  | {:error, non_neg_integer(), String.t()}
  | {:ok, non_neg_integer(), String.t()}

handle_fwup_message will be called with this data

handle_fwup_message_fun()

@type handle_fwup_message_fun() :: (fwup_message() -> any())

Callback that will be called during the lifecycle of a fwupdate being applied

t()

@type t() :: %NervesHubLink.FwupConfig{
  fwup_devpath: Path.t(),
  fwup_env: [{String.t(), String.t()}],
  fwup_task: String.t(),
  handle_fwup_message: handle_fwup_message_fun(),
  update_available: update_available_fun()
}

update_available_fun()

@type update_available_fun() :: (NervesHubLink.Message.UpdateInfo.t() ->
                             :ignore | {:reschedule, timeout()} | :apply)

Called when an update has been dispatched via NervesHubLink.UpdateManager.apply_update/2

Functions

validate!(args)

@spec validate!(t()) :: t()

Raises an ArgumentError on invalid arguments