Skip to content

Commit

Permalink
Merge pull request #27 from royveshovda/feature/24-publish-1-0
Browse files Browse the repository at this point in the history
Publish 1.0
  • Loading branch information
royveshovda authored Oct 8, 2022
2 parents c992b5a + 19a923c commit 86b8398
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ GPS for Elixir

XGPS runs as an application and will start along with you application, and connect to an serial port to get GPS data.

## [__!!! Breaking changes for 1.0 !!!__](breaking_1.0.md)

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
Expand Down
52 changes: 52 additions & 0 deletions breaking_1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Breaking changes for 1.0
Config API has been rewritten to use Keyword list instead of tuples. This will allow for more flexible config API for future extensions.

## Valid config

```elixir
config :xgps, port_to_start: [port_name: "/dev/ttyUSB0", driver: "PMTK", speed: 9600]
```

Where only `port_name` is mandatory. Default values:
- `driver`: "Generic"
- `speed`: 9600

Valid config for simulation is:

```elixir
config :xgps, port_to_start: [port_name: :simulate, file_name: "simulator_positions.txt"]
```

You can skip the `file_name` parameter if you want to control the positions sent (for example for testing scenarios).

## Not valid anymore

These config variants needs to be updated

### Variant 1

Not valid:

```elixir
config :xgps, port_to_start: {"dev/ttyUSB0", :init_adafruit_gps}
```

Will have to change to:

```elixir
config :xgps, port_to_start: [port_name: "/dev/ttyUSB0", driver: "PMTK"]
```

### Variant 2

Not valid:

```elixir
config :xgps, port_to_start: {"dev/ttyUSB0", "GP04S"}
```

Will have to change to:

```elixir
config :xgps, port_to_start: [port_name: "/dev/ttyUSB0", driver: "Generic", speed: 4800]
```
2 changes: 1 addition & 1 deletion lib/xgps/ports.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule XGPS.Ports do
Open one port to be consumed. Needs to have one GPS attached to the port to work.
To simulate, give port_name = :simulate.
Either give just the name of the port as parameter, or a keyword list with the following format: [port_name: "<PORTNAME>", driver: "<DRIVERNAME>", speed: <SPEED_AS_INT>].
Only portname is mandatory in the keyword list.
Only port_name is mandatory in the keyword list. Default values: driver: "Generic", speed: 9600
"""
def start_link do
result = {:ok, pid} = DynamicSupervisor.start_link(__MODULE__, :ok, name: __MODULE__)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule XGPS.Mixfile do
def project do
[app: :xgps,
name: XGPS,
version: "0.7.0",
version: "1.0.0",
elixir: "~> 1.10",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
Expand Down

0 comments on commit 86b8398

Please sign in to comment.