View Source NervesHubLink.FwupConfig (nerves_hub_link v2.5.2)

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

@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

Link to this type

handle_fwup_message_fun()

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

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

@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()
}
Link to this type

update_available_fun()

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

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

Raises an ArgumentError on invalid arguments