Fwup.Stream (fwup v1.1.0)

Copy Markdown

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

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

Types

options()

@type 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

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

send_chunk(fwup, chunk, timeout \\ 60000)

@spec 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.

start_link(init_args)

@spec 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.

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

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