Skip to content

Commit

Permalink
Add a getting started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
danielspofford committed Apr 10, 2019
1 parent 299561e commit 8d6d321
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 14 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,3 @@ An Elixir Bluetooth Host library.
Active early development, reliable semantic versioning.

[Documentation](https://hexdocs.pm/harald).

## Installation

Check [Hex](https://hex.pm/packages/harald) or run `mix hex.info harald` to explore versions available to add to your Mix file.

## Development

### Testing

Run `mix test.watch` to run all the test / qa tools everytime a file changes.
34 changes: 34 additions & 0 deletions guides/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Getting Started

## Usage

Add the dependency:

```elixir
{:harald, "0.1.1"}
```

Start a transport:

```elixir
{Harald.Transport,
namespace: :bt,
adapter: {Harald.Transport.UART, device: "/dev/ttyAMA0", uart_opts: [speed: 115_200]}}
```

The namespace will be used when issuing commands (like scan):

```elixir
Harald.LE.scan(:bt)
```

## Board Setup

### Rpi3

1. add a custom `fwup.conf` based on the Nerves Rpi3's so you may point to a
custom `config.txt`
2. add a custom `config.txt` based on the Nerves Rpi3's so you may comment out
`dtoverlay=pi3-miniuart-bt`

See: [harald_example_rpi3](github.com/verypossible/harald_example_rpi3)
3 changes: 3 additions & 0 deletions guides/testing/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Testing

Run `mix test.watch` to run all the test / qa tools everytime a file changes.
11 changes: 9 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Harald.MixProject do
{:circuits_uart, "~> 1.3"},
{:credo, "~> 1.0", runtime: false},
{:dialyxir, "0.5.1", runtime: false},
{:ex_doc, "~> 0.19", only: [:dev], runtime: false},
{:ex_doc, "~> 0.20.1", only: [:dev], runtime: false},
{:excoveralls, "~> 0.10", only: [:test], runtime: false},
{:mix_test_watch, "~> 0.9", only: [:dev], runtime: false},
{:stream_data, "~> 0.1", only: [:test]}
Expand All @@ -55,7 +55,14 @@ defmodule Harald.MixProject do
[
main: "readme",
extras: [
"README.md"
"README.md",
"guides/getting_started.md",
"guides/testing/testing.md"
],
extra_section: "GUIDES",
groups_for_extras: [
Guides: ~r/guides\/[^\/]+\.md/,
Testing: ~r/guides\/testing\/.?/
]
]
end
Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"circuits_uart": {:hex, :circuits_uart, "1.3.0", "a489e648f358fb3c59e8dd146ead4295cec09d8abae3a0024be2fe3a0b6ddf8b", [:mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"credo": {:hex, :credo, "1.0.0", "aaa40fdd0543a0cf8080e8c5949d8c25f0a24e4fc8c1d83d06c388f5e5e0ea42", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [:mix], [], "hexpm"},
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"},
"elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"},
"erlex": {:hex, :erlex, "0.1.6", "c01c889363168d3fdd23f4211647d8a34c0f9a21ec726762312e08e083f3d47e", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.20.1", "88eaa16e67c505664fd6a66f42ddb962d424ad68df586b214b71443c69887123", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"excoveralls": {:hex, :excoveralls, "0.10.5", "7c912c4ec0715a6013647d835c87cde8154855b9b84e256bc7a63858d5f284e3", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"},
"hackney": {:hex, :hackney, "1.15.0", "287a5d2304d516f63e56c469511c42b016423bcb167e61b611f6bad47e3ca60e", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
Expand Down

0 comments on commit 8d6d321

Please sign in to comment.