Skip to content

Commit

Permalink
Merge pull request #43 from verypossible/changelog
Browse files Browse the repository at this point in the history
Add changelog and tidy up
  • Loading branch information
danielspofford committed May 27, 2019
2 parents af3f9b1 + aa164f3 commit bc7d55a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 0.2.0

## Breaking Changes

- [ManufacturerData] `deserialize/1` returns `{:error, bin}` instead of
`{:error, {:unhandled_company_id, bin}}`
- [Event] `deserialize/1` returns `{:error, bin}` instead of
`{:error, {:bad_event_code, bin}}`
- [Apple] when attempting to deserialize a non-binary term, crash
- [AdvertisingReport] `deserialize/1` always returns
`{status, %AdvertisingReport{}}`
- [Device]
- when attempting to deserialize a non-binary term, crash
- faults nested within a device discovered during deserialization will no
longer be realized through tuples like `{:early_termination, 0}`, instead
the violating binary will be returned as-is

## Enhancements

- [Apple] `deserialize/1` returns `{:error, bin}` instead of crashing on invalid
input
- [ArrayedData] `deserialize/1` returns `{:error, bin}` instead of crashing on
invalid input
- [Transport]
- `LE` is always included as a handler WRT `Transport`
- errors during deserialization no longer prevent a Bluetooth event from being
dispatched to handlers
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Harald

[![Hex version badge](https://img.shields.io/hexpm/v/harald.svg)](https://hex.pm/packages/harald)
[![CircleCI](https://circleci.com/gh/verypossible/harald.svg?style=svg)](https://circleci.com/gh/verypossible/harald)
[![Coverage Status](https://coveralls.io/repos/github/verypossible/harald/badge.svg)](https://coveralls.io/github/verypossible/harald)

An Elixir Bluetooth Host library.

Active early development, reliable semantic versioning.
Active early development, the [CHANGELOG](CHANGELOG.md) is your friend.

[Documentation](https://hexdocs.pm/harald).
[Getting Started](https://hexdocs.pm/harald/getting_started).
16 changes: 9 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

## Shipping a new version

1. Update version in mix.exs
1. ensure CHANGELOG.md is updated and merged into master

2. Commit changes above with title "Release vVERSION"
2. update version in mix.exs

3. Open a pull request for release commit.
3. commit changes above with title "Release vVERSION"

4. Once merged and CI passes for master,
4. open a pull request for release commit

5. Checkout latest master locally.
5. once merged and CI passes for master

6. Create and push a git tag for release.
6. checkout latest master locally

7. `mix hex.publish`
7. create and push a git tag for release

8. `mix hex.publish`
2 changes: 1 addition & 1 deletion lib/harald/hci/arrayed_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule Harald.HCI.ArrayedData do
"""
def deserialize(schema, length, struct_module, bin)

def deserialize(_, length, _, <<>>) when length > 0, do: {:error, :incomplete}
def deserialize(_, length, _, <<>> = bin) when length > 0, do: {:error, bin}

def deserialize(schema, length, struct_module, bin) do
schema
Expand Down
2 changes: 1 addition & 1 deletion test/harald/hci/arrayed_data_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Harald.HCI.ArrayedDataTest do

describe "deserialize/4" do
test "an empty binary results in an error" do
assert {:error, :incomplete} == ArrayedData.deserialize([], 1, Device, <<>>)
assert {:error, <<>>} == ArrayedData.deserialize([], 1, Device, <<>>)
end
end
end

0 comments on commit bc7d55a

Please sign in to comment.