Fwup.Stream (fwup v1.1.0)

Process wrapper around the fwup port. Should be used with --framing

Link to this section Summary

Types

GenServer options

Functions

Returns a specification to start this module under a supervisor.

Send a chunk of data to FWUP

Start a FWUP stream

Link to this section Types

Specs

options() :: [name: atom(), cm: pid(), fwup_args: [String.t()]]

GenServer options

  • :name - the name of the GenServer
  • :cm - where to send fwup messages
  • :fwup_args - arguments to pass to fwup
  • :fwup_env - a list of tuples to pass in the OS environment to fwup

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

send_chunk(fwup, chunk, timeout \\ 60000)

Specs

send_chunk(GenServer.server(), iodata(), timeout()) :: :ok

Send a chunk of data to FWUP

This passes the data to FWUP for processing. Depending on how much data needs to be written, this may take seconds to return. Delta firmware updates, for example, compress extremely well and need to write a lot of data before they're finished processing.

Link to this function

start_link(init_args)

Specs

start_link(options()) :: GenServer.on_start()

Start a FWUP stream

Warning

By default will create a global named process. This means that ideally you can not open two streams at once.

Link to this function

start_link(cm, args, opts \\ [name: __MODULE__])

This function is deprecated. Use Fwup.Stream.start_link/1 instead.