jjcarstens / elixir-fwup

WIP fwup wrapper for Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fwup

CircleCI Hex version

Simple Elixir wrapper around FWUP

Usage

iex()> fw = "/path/to/fwup_file.fw"
iex()> [[dev, _size]] = Fwup.devices()
iex()> args = ["-a", "-t", "complete", "-d", dev]
iex()> {:ok, fwup} = Fwup.stream(self(), args)
iex()> File.stream!(fw, [:bytes], 4096)
iex..>  |> Stream.map(fn chunk ->
iex..>    Fwup.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 fwup to your list of dependencies in mix.exs:

def deps do
  [
    {:fwup, "~> 0.3.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/fwup.

About

WIP fwup wrapper for Elixir

License:Other


Languages

Language:Elixir 99.1%Language:Ruby 0.9%