nerves_hub v0.7.4 NervesHub.HTTPFwupStream

Download and install a firmware update.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Download and install the firmware at the specified URL

Start the downloader process

Stop the downloader

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

get(pid, url)
get(GenServer.server(), String.t()) :: :ok

Download and install the firmware at the specified URL

Link to this function

get_header(headers, key)

Link to this function

start_link(cb)
start_link(pid()) :: GenServer.on_start()

Start the downloader process

A callback process should be passed

Messages will be received in the shape:

  • {:fwup_message, message} - see the docs for Fwup for more info.
  • {:http_error, {status_code, body}}
  • {:http_error, :timeout}
  • {:http_error, :too_many_redirects}
Link to this function

stop(pid)
stop(GenServer.server()) :: :ok

Stop the downloader