nerves_hub_link_http v0.8.2 NervesHubLinkHTTP.Client behaviour
A behaviour module for customizing the tool used for HTTP requests to NervesHub.
Also allows handling FWUP messages and errors
By default, :hackney
is used for completing HTTP requests and all FWUP messages
are logged to STDOUT. To specify your own module to use, update your config.exs
config :nerves_hub_link_http, client: MyApp.NervesHubLinkHTTP.Client
Link to this section Summary
Types
Firmware update progress, completion or error report
Functions
This function is called internally by NervesHubLinkHTTP to notify clients of fwup errors.
This function is called internally by NervesHubLinkHTTP to notify clients of fwup progress.
Callbacks
Called when downloading a firmware update fails.
Called on firmware update reports.
Performs the HTTP request
Link to this section Types
fwup_message()
fwup_message() :: {:ok, non_neg_integer(), String.t()} | {:warning, non_neg_integer(), String.t()} | {:error, non_neg_integer(), String.t()} | {:progress, 0..100}
Firmware update progress, completion or error report
Link to this section Functions
This function is called internally by NervesHubLinkHTTP to notify clients of fwup errors.
This function is called internally by NervesHubLinkHTTP to notify clients of fwup progress.
request(method, path, params, opts \\ [])
Link to this section Callbacks
Called when downloading a firmware update fails.
The return value of this function is not checked.
Called on firmware update reports.
The return value of this function is not checked.
request(method, url, list, body, opts)
Performs the HTTP request