Skip to content

Commit

Permalink
Merge in NervesHubLinkCommon (#120)
Browse files Browse the repository at this point in the history
Migrate code back into the main library now that the HTTP version is
deprecated and doesn't work in NervesHub 2.0
  • Loading branch information
oestrich authored Jun 27, 2023
1 parent cb1e27d commit 65dec0d
Show file tree
Hide file tree
Showing 27 changed files with 1,699 additions and 15 deletions.
18 changes: 18 additions & 0 deletions .credo.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .credo.exs
%{
configs: [
%{
name: "default",
strict: true,
checks: [
{Credo.Check.Design.TagTODO, false},
{Credo.Check.Refactor.MapInto, false},
{Credo.Check.Warning.LazyLogging, false},
{Credo.Check.Readability.LargeNumbers, only_greater_than: 86400},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, parens: true},
{Credo.Check.Readability.Specs, tags: []},
{Credo.Check.Readability.StrictModuleLayout, tags: []}
]
}
]
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ This release only bumps the version number. It doesn't have any code changes.
* This enforces the update data structure exchanged between device and server
and is mostly internal. However, if you implement your own `NervesHubLink.Client`
behavior, then you will need to your `NervesHubLink.Client.update_available/1` to
accept a `%NervesHubLinkCommon.Message.UpdateInfo{}` struct as the parameter
accept a `%NervesHubLink.Message.UpdateInfo{}` struct as the parameter
instead of a map with string keys which was used until this point.

* Enhancements
Expand Down
4 changes: 2 additions & 2 deletions lib/nerves_hub_link.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ defmodule NervesHubLink do
@doc """
Current status of the update manager
"""
@spec status :: NervesHubLinkCommon.UpdateManager.State.status()
defdelegate status(), to: NervesHubLinkCommon.UpdateManager
@spec status :: NervesHubLink.UpdateManager.State.status()
defdelegate status(), to: NervesHubLink.UpdateManager

@doc """
Restart the socket and device channel
Expand Down
4 changes: 2 additions & 2 deletions lib/nerves_hub_link/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ defmodule NervesHubLink.Application do
alias NervesHubLink.Configurator
alias NervesHubLink.Connection
alias NervesHubLink.Socket
alias NervesHubLinkCommon.FwupConfig
alias NervesHubLinkCommon.UpdateManager
alias NervesHubLink.FwupConfig
alias NervesHubLink.UpdateManager

def start(_type, _args) do
config = Configurator.build()
Expand Down
2 changes: 1 addition & 1 deletion lib/nerves_hub_link/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule NervesHubLink.Client do
require Logger

@typedoc "Update that comes over a socket."
@type update_data :: NervesHubLinkCommon.Message.UpdateInfo.t()
@type update_data :: NervesHubLink.Message.UpdateInfo.t()

@typedoc "Supported responses from `update_available/1`"
@type update_response :: :apply | :ignore | {:reschedule, pos_integer()}
Expand Down
Loading

0 comments on commit 65dec0d

Please sign in to comment.