ExFwup
Simple Elixir wrapper around FWUP
Usage
iex()> fw = "/path/to/fwup_file.fw"
iex()> [[dev, _size]] = ExFwup.devices()
iex()> args = ["-a", "-t", "complete", "-d", dev]
iex()> {:ok, fwup} = ExFwup.stream(self(), args)
iex()> File.stream!(fw, [:bytes], 4096)
iex..> |> Stream.map(fn chunk ->
iex..> ExFwup.send_chunk(fwup, chunk)
iex..> end)
iex..> |> Stream.run()
iex()> flush()
{:progress, 0}
{:progress, 1}
# many more
{:progess, 100}
{:ok, 0, ""}Installation
If available in Hex, the package can be installed
by adding ex_fwup to your list of dependencies in mix.exs:
def deps do
[
{:ex_fwup, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_fwup.