Skip to content

Commit 5b2512c

Browse files
committed
Simple functions docs
1 parent 33c9cd4 commit 5b2512c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/nerves_hub/device_link/connections.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ defmodule NervesHub.DeviceLink.Connections do
1818
@type auth() :: {:ssl_certs, any()} | {:shared_secrets, list()}
1919
@type connection_id() :: binary()
2020

21+
@doc """
22+
Find and connect a device. Devices can also be created, if the strategy supports it.
23+
"""
2124
@spec connect_device(auth()) :: {:ok, {connection_id(), Device.t()}} | {:error, :invalid_auth}
2225
def connect_device(auth)
2326

@@ -60,6 +63,9 @@ defmodule NervesHub.DeviceLink.Connections do
6063
end
6164
end
6265

66+
@doc """
67+
Mark a device as disconnected.
68+
"""
6369
@spec disconnect_device(any(), Device.t(), connection_id()) :: :ok
6470
def disconnect_device(reason, device, reference_id)
6571

@@ -85,6 +91,9 @@ defmodule NervesHub.DeviceLink.Connections do
8591
:ok
8692
end
8793

94+
@doc """
95+
Mark a device as still connected and alive.
96+
"""
8897
@spec device_heartbeat(connection_id()) :: :ok
8998
def device_heartbeat(reference_id) do
9099
DeviceConnections.device_heartbeat(reference_id)

0 commit comments

Comments
 (0)