NervesHubLink.UpdateManager (nerves_hub_link v2.7.3)

View Source

GenServer responsible for brokering messages between:

  • an external controlling process
  • FWUP
  • HTTP

Should be started in a supervision tree

Summary

Functions

Must be called when an update payload is dispatched from NervesHub. the map must contain a "firmware_url" key.

Returns the UUID of the currently downloading firmware, or nil.

Returns the current status of the update manager

Types

status()

@type status() ::
  :idle
  | {:fwup_error, String.t()}
  | :update_rescheduled
  | {:updating, integer()}

Functions

apply_update(manager \\ __MODULE__, update_info, fwup_public_keys)

Must be called when an update payload is dispatched from NervesHub. the map must contain a "firmware_url" key.

currently_downloading_uuid(manager \\ __MODULE__)

@spec currently_downloading_uuid(GenServer.server()) :: uuid :: String.t() | nil

Returns the UUID of the currently downloading firmware, or nil.

status(manager \\ __MODULE__)

@spec status(GenServer.server()) :: status()

Returns the current status of the update manager