View Source NervesHubLinkCommon.FwupConfig (nerves_hub_link_common v0.4.0)

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

Link to this section 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 NervesHubLinkCommon.UpdateManager.apply_update/2

Functions

Raises an ArgumentError on invalid arguments

Link to this section 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() :: %NervesHubLinkCommon.FwupConfig{
  fwup_devpath: Path.t(),
  fwup_env: [{String.t(), String.t()}],
  fwup_public_keys: [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() ::
  (NervesHubLinkCommon.Message.UpdateInfo.t() ->
     :ignore | {:reschedule, timeout()} | :apply)

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

Link to this section Functions

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

Raises an ArgumentError on invalid arguments